Method and system for counting fees based on user order relation

By entering resource package data, obtaining user information, analyzing call order data and deducting resources in telecom value-added services, the problem of accurate deduction caused by the complex subscription of users is solved, and efficient and accurate statistical cost processing is achieved.

CN119893453APending Publication Date: 2025-04-25GUIYANG LONGMA COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411942865.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In telecom value-added services, the packages ordered by users are complex and numerous, which leads to operators facing the problems of large amount of data and high business complexity when counting user resource data and consumption records, making it difficult to achieve accurate deductions.

Method used

By entering the operator's resource package data, obtaining user information and querying the ordered resource package ID, receiving and analyzing the order data generated by user consumption, deducting the resource amount based on the resource package priority and user resource amount and entering the consumption record, and finally generating a fee bill and deducting the fee.

Benefits of technology

It realizes efficient and accurate statistical fees based on user ordering relationships, ensures the accuracy and completeness of user resource data and consumption records, and achieves accurate deductions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893453A_ABST
    Figure CN119893453A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for counting cost based on a user order relation, and the method comprises the steps: inputting resource packet data of an operator, the resource packet data comprising a resource packet ID, a price, a resource type and a resource amount; obtaining user information, querying a resource packet ID ordered by the user, and adding a corresponding resource type and a resource quantity for the user; receiving and storing ticket data generated by user consumption, analyzing the ticket data according to a preset time and a preset processing amount, deducting the resource amount consumed by the user according to an analysis result and a resource packet priority, and inputting a consumption record; and counting the consumption record and the ordered resource packet ID, generating a fee bill, and carrying out fee deduction processing on a user account according to the payment mode of the user and the fee bill. Through the scheme, the use cost of the user can be efficiently and accurately counted, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of value-added telecommunication services, and in particular to a method and system for calculating fees based on user subscription relationships. Background Art

[0002] With the development of value-added telecommunications services, operators have stepped up their efforts to develop value-added services. When providing services to users, operators will offer a variety of packages for users to choose from, including voice, SMS, traffic, business card, call forwarding, etc. Operators need to accurately deduct user package resources and real-time expenses based on the packages ordered by users and their usage.

[0003] In fact, the package subscribed by the user is a combination of resource packages provided by the operator. By querying the user's subscription relationship, the resource package subscribed by the user can be obtained. However, the number of value-added service users is large, and the subscription packages are complex and numerous. Every time a user makes a consumption, a consumption record is generated. Based on monthly statistics, the number of call records is nearly one million, and the data is on an upward trend. In the context of large data volume and high business complexity, operators need to ensure the accuracy and completeness of user resource data and user consumption records to achieve accurate deductions. Therefore, it is necessary to provide a general technical solution to achieve efficient and accurate cost statistics based on user subscription relationships. Summary of the invention

[0004] The main purpose of the present invention is to disclose a method and system for counting costs based on user subscription relationships, so as to achieve efficient and accurate cost counting.

[0005] In a first aspect, a method for calculating costs based on user subscription relationships is provided.

[0006] A method for calculating costs based on user subscription relationships according to the present invention includes:

[0007] Enter the operator's resource package data, wherein the resource package data includes resource package ID, price, resource type, and resource quantity;

[0008] Obtain user information, query the resource package ID subscribed by the user, and add the corresponding resource type and resource quantity for the user;

[0009] Receive and save the call data generated by the user's consumption, parse the call data according to a preset time and a preset processing volume, deduct the amount of resources consumed by the user according to the parsing result and the priority of the resource package, and enter the consumption record;

[0010] The consumption records and the IDs of the subscribed resource packages are counted to generate a fee bill, and the user account is deducted according to the user's payment method and the fee bill.

[0011] Preferably, the obtaining of user information further comprises: automatically obtaining at a preset time, obtaining through call bill data pushed by an operator, and automatically obtaining when a user subscription relationship is changed.

[0012] Preferably, the querying of the resource package IDs ordered by the user further comprises: querying the resource package IDs previously and currently ordered by the user to determine whether the ordering relationship of the user has changed.

[0013] Preferably, deducting the amount of resources consumed by the user and recording the consumption record also includes: determining whether the amount of resources of the user is sufficient for deduction, if so, recording a consumption record with a price of 0; if not, calculating the consumption fee based on the type, amount and price of resources consumed by the user, and recording the actual consumption record.

[0014] Preferably, the counting of the consumption records and the subscribed resource package IDs to generate a fee bill further includes: calculating the subscribed resource package fee according to the price of the subscribed resource package ID, adding the consumption records, and generating a fee bill.

[0015] In a second aspect, a system for calculating costs based on user ordering relationships is provided.

[0016] A system for calculating costs based on user subscription relationships according to the present invention comprises:

[0017] An input module, used to input the operator's resource package data, wherein the resource package data includes resource package ID, price, resource type, and resource quantity;

[0018] An acquisition module is used to acquire user information, query the resource package ID subscribed by the user, and add the corresponding resource type and resource quantity for the user;

[0019] A parsing module, used to receive and save the call bill data generated by the user's consumption, parse the call bill data according to a preset time and a preset processing volume, deduct the amount of resources consumed by the user according to the parsing result and the resource package priority, and enter the consumption record;

[0020] The statistics module is used to count the consumption records and the IDs of the subscribed resource packages, generate a fee bill, and deduct fees from the user account according to the user's payment method and the fee bill.

[0021] Preferably, the acquisition module is further used to acquire the user information by one of automatically acquiring at a preset time, acquiring through call bill data pushed by an operator, and automatically acquiring when a user subscription relationship is changed.

[0022] Preferably, the acquisition module is further used to query the resource package IDs previously and currently ordered by the user to determine whether the ordering relationship of the user has changed.

[0023] Preferably, the analysis module is also used to determine whether the user's resource volume is sufficient for deduction. If so, a consumption record with a price of 0 is entered. If not, the consumption fee is calculated based on the resource type, resource volume and price consumed by the user, and the actual consumption record is entered.

[0024] Preferably, the statistical module is further used to calculate the cost of the ordered resource package according to the price of the ordered resource package ID, and add the consumption record to generate a cost bill. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a flow chart of a method for calculating costs based on user subscription relationships according to an embodiment of the present invention;

[0026] Figure 2 The present invention is a schematic diagram of a system structure for calculating fees based on user subscription relationships according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the embodiments of the present invention more clearly understood, the spirit of the contents disclosed by the present invention will be clearly explained with the accompanying drawings and detailed descriptions below. After understanding the embodiments of the contents of the present invention, any technician in the relevant technical field can change and modify the techniques taught by the contents of the present invention without departing from the spirit and scope of the contents of the present invention.

[0028] Figure 1 A flowchart of an implementation method of a method for calculating fees based on user subscription relationships provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0029] S1, inputting the operator's resource package data, wherein the resource package data includes resource package ID, price, resource type, and resource quantity.

[0030] In the embodiment of the present application, according to the information provided by the operator, the resource package data is entered into the database, including the resource package ID (unique identifier), price, resource type, resource quantity, etc. The resource quantity column is stored in json string format to facilitate the program to obtain the specific resource quantity. Resource types include traffic, SMS, call time, etc.

[0031] S2, obtaining user information, querying the resource package ID subscribed by the user, and adding the corresponding resource type and resource quantity for the user.

[0032] In the embodiment of the present application, there are three main ways to obtain user information that needs to be opened: one is to automatically obtain it through a preset time, such as setting the program to automatically obtain it at midnight on the 1st of each month, and this information is generated by other programs; the second is to obtain it through the call bill data pushed by the operator. For example, when the operator pushes the user's call bill, if the user has not opened an account (there is a certain time difference), the program obtains the user information in the call bill; the third is to automatically obtain it when the user's subscription relationship changes. When the user's subscription relationship changes, other programs push the user information to the program.

[0033] Since there is a lot of user data and a single user may subscribe to multiple resource packages, the program only processes one user at a time when opening an account. After obtaining the user information, the user data is pushed into the message queue in a loop. At the same time, the message queue consumer periodically obtains user information from the message queue. After obtaining the single user information, it queries the resource package ID subscribed by the user (usually there are multiple ones) and adds the corresponding resource information for the user. This also includes querying the resource package IDs previously and currently subscribed by the user to determine whether the user's subscription relationship has changed. In this process, there are two situations for users: those who have added resources and those who have not added resources. Regardless of the situation, the program handles it in the same way.

[0034] Take the example of a user who has added resources (this case exists in the account opening triggered by the change of the user's subscription relationship): First, it is found that the resource package IDs that user 131****8813 has added are: A_0001, B_0001, C_0001, and the format of the resource package ID can be set by yourself.

[0035] When adding the corresponding resource type and resource quantity for the user, first obtain the resources that the user has added (for users who open an account for the first time in the month, this data is empty), and determine whether the user's subscription relationship has changed. For example, if the user has newly subscribed to the A_0001 resource package, add the A_0001 package content for user 131****8813. The implementation method is to traverse the user's resource package information, concatenate numbers after the resource package ID, and add 1 to the concatenated number each time the resource package appears, that is, to obtain two arrays ['A_0001-1', 'B_0001-1', 'C_0001-1'] and ['A_0001-1', 'A_0001-2', 'B_0001-1', 'C_0001-1']. After the construction is completed, the two arrays are compared, and the part of the latter that is larger than the former is taken as the concatenated resource package ID. The excess array is traversed, and the array is split with '-' to obtain the resource package ID that needs to be added to the user, and the resource package data is queried through the ID.

[0036] According to the user's previous subscription relationship and the currently changed subscription relationship, after obtaining the resource package data, different resources are added to the user according to the resource type. The resource quantity part is in json string format. After being converted into dictionary format in the program, the user resource quantity is obtained according to the keyword, such as: resource ['gprs'] is a traffic resource, the sms keyword is a text message resource, voice is a voice resource, etc., and resources are added to the user in the above way.

[0037] S3, receiving and saving the call bill data generated by the user's consumption, parsing the call bill data according to a preset time and a preset processing volume, deducting the amount of resources consumed by the user according to the parsing result and the priority of the resource package, and entering the consumption record.

[0038] In the embodiment of the present application, the only source of the call bill is the operator side, which generates a txt file based on the actual consumption record of the user, stores it in the corresponding server hard disk, and parses the call bill data according to the preset time and preset processing volume. For example, it is set to read 100 txt files from the program every 10 seconds for parsing (the data can be adjusted according to the actual call bill volume and hardware resources), and pushes it into the message queue after parsing. The program periodically takes out data from the message queue, and determines the amount of resources corresponding to the user to be deducted according to the type of call bill. When deducting, due to the priority of resource packages, resource packages with higher priorities are deducted first. In addition, when deducting, it is also necessary to determine whether the user's resources are sufficient for deduction. If the user's resources are sufficient to deduct the consumed resources, a consumption record with a price of 0 is entered. After traversing all resources, it is not enough to deduct the consumption. Then, the excess resource cost is calculated according to the unit price of this resource, and a consumption record of the actual cost is entered. In an embodiment of the present application, the user's resource amount is deducted in real time based on the user's call bill. If the user's remaining resource amount is sufficient to deduct the resource amount of the call bill, it is called "in-package resources". The in-package resources only deduct resources and usually do not incur additional fees. If it is not sufficient to deduct the resource amount of the call bill, "out-of-package resources" will be generated. The out-of-package fees incurred by the user are calculated based on the out-of-package resources and the subscription relationship.

[0039] To improve efficiency, use redis to store a key containing the user ID, and the value is the resource type. Before deducting resources, the user first reads the value of redis. If there is a value of this type, the out-of-pocket fee is directly generated. When the user re-triggers the account opening, the redis data corresponding to the user is deleted.

[0040] S4, counting the consumption records and the ID of the subscribed resource package, generating a fee bill, and deducting the user account according to the user's payment method and the fee bill.

[0041] In the embodiment of the present application, the user's fee bill data mainly comes from the price of the resource package when opening the account and the call bill consumption. According to the price of the resource package ID ordered by the user, the ordered resource package fee is calculated, and the consumption record (call bill consumption) is added to generate a fee bill, and the fee is deducted according to the bill.

[0042] According to an embodiment of the present invention, a system for calculating costs based on user subscription relationships is also provided. Figure 2 As shown, the system includes:

[0043] The input module 201 is used to input the operator's resource package data, wherein the resource package data includes a resource package ID, price, resource type, and resource quantity.

[0044] The acquisition module 202 is used to acquire user information, query the resource package ID subscribed by the user, and add the corresponding resource type and resource quantity for the user.

[0045] The acquisition module 202 has three ways to acquire user information, including automatic acquisition at a preset time, acquisition through the operator's push of call data, and automatic acquisition when the user's subscription relationship changes. The acquisition module 202 is also used to query the resource package IDs previously and currently ordered by the user to determine whether the user's subscription relationship has changed.

[0046] The analysis module 203 is used to receive and save the call bill data generated by the user's consumption, analyze the call bill data according to the preset time and preset processing volume, deduct the amount of resources consumed by the user according to the analysis result and the resource package priority, and enter the consumption record.

[0047] In this embodiment, the analysis module 203 is also used to determine whether the user's resource volume is sufficient for deduction. If so, a consumption record with a price of 0 is entered. If not, the consumption fee is calculated based on the resource type, resource volume and price consumed by the user, and the actual consumption record is entered.

[0048] The statistics module 204 is used to count the consumption records and the IDs of the subscribed resource packages, generate a fee bill, and deduct fees from the user account according to the user's payment method and the fee bill.

[0049] In this embodiment, the statistics module 204 is further used to calculate the cost of the ordered resource package according to the price of the ordered resource package ID, and add the consumption record to generate a cost bill.

[0050] In summary, with the aid of the above implementation modes provided by the present invention, efficient and accurate cost statistics can be achieved based on user subscription relationships.

[0051] So far, the technical solutions of the present invention have been described in conjunction with the embodiments shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0052] The above descriptions are only several specific embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for calculating costs based on user ordering relationships, characterized in that: The method comprises: Enter the operator's resource package data, wherein the resource package data includes resource package ID, price, resource type, and resource quantity; Obtain user information, query the resource package ID subscribed by the user, and add the corresponding resource type and resource quantity for the user; Receive and save the call data generated by the user's consumption, parse the call data according to a preset time and a preset processing volume, deduct the amount of resources consumed by the user according to the parsing result and the priority of the resource package, and enter the consumption record; The consumption records and the IDs of the subscribed resource packages are counted to generate a fee bill, and the user account is deducted according to the user's payment method and the fee bill.

2. The method for calculating costs based on user subscription relationships according to claim 1, characterized in that: The obtaining of user information also includes: automatically obtaining through a preset time, obtaining through call bill data pushed by an operator, and automatically obtaining when a user subscription relationship is changed.

3. The method for calculating costs based on user subscription relationships according to claim 1, characterized in that: The querying of the resource package IDs ordered by the user further includes: querying the resource package IDs previously and currently ordered by the user to determine whether the user ordering relationship has changed.

4. The method for calculating costs based on user ordering relationships according to claim 1, characterized in that: The deducting the amount of resources consumed by the user and entering the consumption record also includes: determining whether the amount of resources of the user is sufficient for deduction, if so, entering a consumption record with a price of 0; if not, calculating the consumption fee based on the type of resources, amount of resources and price consumed by the user, and entering the actual consumption record.

5. The method for calculating costs based on user ordering relationships according to claim 1, characterized in that: The counting of the consumption records and the subscribed resource package ID to generate a fee bill also includes: calculating the subscribed resource package fee according to the price of the subscribed resource package ID, adding the consumption records, and generating a fee bill.

6. A system for calculating costs based on user ordering relationships, characterized in that: include: An input module, used to input the operator's resource package data, wherein the resource package data includes resource package ID, price, resource type, and resource quantity; An acquisition module is used to acquire user information, query the resource package ID subscribed by the user, and add the corresponding resource type and resource quantity for the user; A parsing module, used to receive and save the call bill data generated by the user's consumption, parse the call bill data according to a preset time and a preset processing volume, deduct the amount of resources consumed by the user according to the parsing result and the resource package priority, and enter the consumption record; The statistics module is used to count the consumption records and the IDs of the subscribed resource packages, generate a fee bill, and deduct fees from the user account according to the user's payment method and the fee bill.

7. The system for calculating costs based on user subscription relationships according to claim 6, characterized in that: The acquisition module is further used to acquire the user information by one of automatically acquiring at a preset time, acquiring through call bill data pushed by an operator, and automatically acquiring when a user subscription relationship is changed.

8. The system for calculating costs based on user subscription relationships according to claim 6, characterized in that: The acquisition module is further used to query the resource package IDs previously and currently ordered by the user to determine whether the ordering relationship of the user has changed.

9. The system for calculating costs based on user subscription relationships according to claim 6, characterized in that: The analysis module is also used to determine whether the user's resource volume is sufficient for deduction. If so, a consumption record with a price of 0 is entered. If not, the consumption fee is calculated based on the resource type, resource volume and price consumed by the user, and the actual consumption record is entered.

10. The system for calculating costs based on user subscription relationships according to claim 6, characterized in that: The statistical module is further used to calculate the cost of the ordered resource package according to the price of the ordered resource package ID, and generate a cost bill by adding the consumption record.