Business flow fee deduction method and device, computer equipment and storage medium

By querying the attribute information of order information in the first database of the business traffic deduction system to determine whether deduction is allowed, and querying the second database for fee bills to perform deduction operations, the system is solving the problem of handling a large amount of deductions in a large amount of deductions. Errors and duplicate deductions during requests improve system performance.

CN119449506AInactive Publication Date: 2025-02-14BEIJING FENGHUANG XUE YI SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411745429.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing business traffic deduction systems are prone to incorrect deductions or repeated deductions when handling large amounts of deduction requests, resulting in system performance degradation.

Method used

By querying the attribute information of the order information in the first database to determine whether deduction is allowed, the second database is only queried for the expense bill of the business traffic and the deduction operation is performed if the deduction is allowed.

Benefits of technology

This reduces system performance problems caused by concentrated deduction requests, reduces the incidence of wrong deductions and repeated deductions, thereby improving the processing performance of the service traffic deduction system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449506A_ABST
    Figure CN119449506A_ABST
Patent Text Reader

Abstract

The invention discloses a service flow fee deduction method and device, computer equipment and a computer storage medium, the method is applied to the computer equipment, and the method comprises the following steps: receiving a service flow fee deduction request; determining order information associated with the fee deduction request based on the fee deduction request; querying attribute information of the order information in a first database according to the order information; according to the attribute information of the order information, determining whether the attribute information of the order information indicates that fee deduction is allowed; if the attribute information of the order information indicates that fee deduction is allowed, service flow corresponding to the order information is inquired from a second database to determine a fee bill corresponding to the service flow, and the memory space of the first database is smaller than that of the second database; and executing a fee deduction operation according to the fee bill corresponding to the service flow. In this way, the fee deduction processing performance of the fee deduction system of the service flow 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 communication billing, and in particular to a method for deducting fees from service flow, computer equipment and storage medium. Background Art

[0002] Currently, operators adopt a pay-per-use billing system for business traffic. However, the rules for pay-per-use billing are relatively complicated, especially for business traffic. Due to the introduction of various traffic packages and other services, the billing of business traffic is also relatively complicated. At the same time, the business traffic deduction system needs to handle many customers at the same time. For example, during the school season, as the business traffic gradually increases, the system is prone to systemic problems such as erroneous deductions or repeated deductions due to the complexity of deduction requests and the large amount of data processed. Based on this, how to reduce the deduction errors of the business traffic deduction system and improve the deduction processing performance of the business traffic deduction system has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] In view of this, the main purpose of the present invention is to provide a business traffic deduction method, device, computer equipment and computer storage medium, aiming to improve the deduction processing performance of the business traffic deduction system.

[0004] To achieve the above object, the technical solution of the present invention is achieved as follows: An embodiment of the present invention provides a service flow fee deduction method, including: A charge request for service traffic is received; Based on the deduction request, determining order information associated with the deduction request; According to the order information, querying the first database for attribute information of the order information; Determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed; If the attribute information of the order information indicates that deduction is allowed, querying the service flow corresponding to the order information from the second database to determine the fee bill corresponding to the service flow; wherein the memory space of the first database is smaller than the memory space of the second database; The deduction operation is performed according to the fee bill corresponding to the business flow.

[0005] In the above scheme, the method further comprises: Determine whether the deduction operation is successful; If the deduction is successful, the result of the successful deduction is fed back to the second database, and a deduction log of the order information is recorded; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: If the attribute information of the order information indicates that deduction is allowed, the current fee bill corresponding to the current business traffic is determined based on the historical deduction log corresponding to the order information.

[0006] In the above scheme, the method further includes: If the deduction is successful, the deduction log is fed back to the first database; The querying the first database for attribute information of the order information according to the order information includes: According to the order information, querying the first database for a deduction log of the order information; Determine attribute information of the order information according to the deduction log of the order information.

[0007] In the above solution, the attribute information of the order information includes at least one of the following: the order effective time interval and the order limit number of copies; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: According to the attribute information of the order information, it is determined that the usage time interval of the service traffic is within the order effective time interval, and it is indicated that the deduction is not allowed; or According to the attribute information of the order information, it is determined that the number of order usage corresponding to the order information is within the order limit number, and it is indicated that deduction is not allowed.

[0008] In the above solution, the attribute information of the order information includes: the correspondence between the deduction request identifier and the order number; The determining, based on the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: determining, based on the correspondence between the deduction request identifier and the order number, whether the correspondence between the deduction request identifier and the order number is unique; If the correspondence between the deduction request identifier and the order number is unique, it indicates that the deduction is allowed.

[0009] In the above scheme, the method further includes: Using the third database to receive a query instruction for querying the second database for the business flow corresponding to the order information; If the attribute information of the order information indicates that deduction is allowed, querying the second database for the service flow corresponding to the order information to determine the fee bill corresponding to the service flow includes: If the attribute information of the order information indicates that deduction is allowed, sending a query instruction to the third database; Based on the query instruction, the second database is queried for the business flow corresponding to the order information to determine the expense bill corresponding to the business flow.

[0010] In the above scheme, the method further includes: If the attribute information of the order information indicates that deduction is allowed, a message is sent to the third database to query the second database for the business traffic corresponding to the order information.

[0011] To achieve the above purpose, the embodiment of the present invention further provides a service flow fee deduction device, including: A first receiving module, configured to receive a charge deduction request for service traffic; A first determining module, configured to determine order information associated with the deduction request based on the deduction request; A first query module, configured to query attribute information of the order information in a first database according to the order information; A second determination module, configured to determine, based on the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed; A second query module is used to query the service flow corresponding to the order information from a second database to determine the fee bill corresponding to the service flow if the attribute information of the order information indicates that deduction is allowed; wherein the memory space of the first database is smaller than the memory space of the second database; The execution module is used to execute the deduction operation according to the fee bill corresponding to the business flow.

[0012] To achieve the above object, an embodiment of the present invention further provides a computer device, the computer device comprising: processor; a memory for storing processor-executable instructions; The processor is used to execute any of the above-mentioned methods for deducting fees from the service traffic.

[0013] To achieve the above objectives, an embodiment of the present invention also provides a computer storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to enable the one or more processors to execute any of the above-mentioned service traffic deduction methods.

[0014] A method, device, computer equipment and storage medium for deducting service traffic provided by an embodiment of the present invention receives a deduction request for service traffic; determines the order information associated with the deduction request based on the deduction request; then queries the attribute information of the order information in a first database according to the order information; determines whether the attribute information of the order information indicates that deduction is allowed according to the attribute information of the order information; if the attribute information of the order information indicates that deduction is allowed, queries the service information corresponding to the order information in a second database to determine the expense bill corresponding to the service traffic; and performs the deduction operation according to the expense bill corresponding to the service traffic. In this way, the embodiment of the present invention first queries the attribute information of the order information in the first database to determine whether deduction is allowed, and only when deduction is allowed will the service traffic corresponding to the order information be queried in the second database, and then the deduction processing is performed according to the currently used service traffic, thereby reducing the problem of deduction errors in the service traffic deduction system caused by deduction in the deduction system as long as there is a deduction request in the prior art, and processing the deduction event through two databases can also reduce the system performance problem caused by the concentration of deduction requests, thereby improving the deduction processing performance of the service traffic deduction system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A flowchart of a method for deducting fees for service traffic provided in some embodiments of the present invention; Figure 2 A schematic diagram of the technical framework of a system for charging service traffic for some embodiments of the present invention; Figure 3 A flowchart of a method for deducting fees for service traffic is provided for other embodiments of the present invention; Figure 4 A schematic diagram of the structure of a service flow fee deduction device provided in some embodiments of the present invention; Figure 5 A schematic diagram of the hardware structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and drawings. Here, the exemplary implementation methods of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0017] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0018] It should be noted that the performance of the current pay-as-you-go interface is poor, and the RT (response time) is high, which directly affects the performance and RT of the charge (the charge burr problem is very obvious, the average RT is 0.2 seconds, and the maximum RT is between 0.5-3 seconds). As the business traffic gradually increases, business personnel will increase their efforts to promote it, and it is necessary to optimize the performance (reduce RT) in advance. In the regular performance stress test of the charge-as-you-go interface during the school season, the RT performance is about 0.2 seconds. The problem is still quite obvious and needs to be optimized one by one. In addition, there are many similar heavy IO (input and output) operations in the system. In summary, the performance of the pay-as-you-go interface needs to be optimized. The following optimization ideas are provided for this poor performance:

[0019] 1. Cache optimization: For the same query order and other information, the query statement and results can be cached in the cache to improve the query response speed.

[0020] 2. Transaction boundary optimization: Reduce the granularity of transactions to a minimum, only include operations that must be in the transaction, reduce the time that transactions hold locks, and improve concurrency performance.

[0021] 3. Database optimization: Analyze query statements and table structures, and create indexes appropriately to speed up queries. Avoid full table scans; try to avoid using columns without indexes for queries, so as not to trigger full table scans and affect performance.

[0022] 4. Code optimization: Use concurrent programming techniques, such as multithreading and thread pools, to improve the concurrent performance of the system, such as concurrent request deductions.

[0023] While these optimization ideas are effective in most cases, they also have some limitations that need to be carefully considered. Cache optimization may lead to high memory consumption and data consistency issues, and transaction boundary optimization may increase code complexity and data consistency challenges. For example, the need to lock a certain section of code may cause transaction inconsistencies, and high requirements are placed on the use and control of locks. Code optimization may reduce readability and maintainability. A single database optimization may be limited by hardware conditions and database versions. Comprehensively considering these limitations and making trade-offs and choices based on specific scenarios can ensure that the optimization measures taken truly improve system performance, and find a balance in terms of feasibility, maintainability, and data consistency. Regular performance testing and monitoring should be performed, and adjustments and improvements should be made based on specific circumstances.

[0024] Based on this, an embodiment of the present invention provides a service flow fee deduction method. Figure 1 A flow chart of a method for deducting service traffic fees provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method is applied to a computer device, and the method includes: Step 101: receiving a request for deduction of service traffic;.

[0025] The computer device here can be a server provided by the operator of the business traffic, which can be used to run the business traffic deduction system, which includes a business traffic deduction interface, which can be used to count and calculate the business traffic of networked users, and perform deduction processing based on the business traffic of networked users.

[0026] The charge request for service traffic here can come from the active request of the network user, or it can be an automatic request when the charge timing event pre-set by the charge system for service traffic occurs. The charge timing event here can be, for example, a charge cycle or a service traffic exhaustion event. Of course, in short, the initiation of the charge request that can trigger the service traffic can be understood as a charge timing event.

[0027] Step 102: Based on the deduction request, determine order information associated with the deduction request.

[0028] The order information here includes but is not limited to the order number and the traffic package of the order.

[0029] In some embodiments, step 102, i.e., determining order information associated with the deduction request based on the deduction request, prior to determining whether a deduction switch is turned on; If the deduction switch is turned on, step 102 is executed, that is, determining the order information associated with the deduction request based on the deduction request; If the deduction switch is turned off, the deduction request will not be executed.

[0030] In some embodiments, if the deduction switch is turned off, an external service is responded to, and the external service here can be used to notify the networked user of the result of the deduction.

[0031] In fact, regardless of whether the deduction operation is successful, the system needs to send a response to the external service that initiated the request to inform them of the result of the deduction.

[0032] Step 103: According to the order information, query the first database for attribute information of the order information.

[0033] Step 104: Determine, based on the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed.

[0034] In some embodiments, the method further comprises: Determine whether the deduction operation is successful; If the deduction is successful, the result of the successful deduction is fed back to the second database, and a deduction log of the order information is recorded; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: If the attribute information of the order information indicates that deduction is allowed, the current fee bill corresponding to the current business traffic is determined based on the historical deduction log corresponding to the order information.

[0035] Step 105: If the attribute information of the order information indicates that deduction is allowed, query the second database for the business traffic corresponding to the order information to determine the fee bill corresponding to the business traffic; wherein the memory space of the first database is smaller than the memory space of the second database.

[0036] In some embodiments, the first database may be a database temporarily used to cache data, such as a Redis database. It is understandable that the Redis database is an open source, in-memory data structure storage system that can be used as a database, cache, and message broker. Because Redis is open source, it allows users to use, modify, and distribute it freely; because Redis mainly stores data in memory, it can provide extremely high read and write speeds; in addition, although Redis mainly uses memory, it also provides two persistence mechanisms: RDB (snapshot) and AOF (append write file) to ensure the persistence of data; Redis also supports a variety of data structures, such as strings, hashes, lists, sets, sorted sets, and other atomic operations: Redis supports atomic operations to ensure data consistency and security.

[0037] In other embodiments, the second database may also be an open source relational management system that uses structured query language (SQL) to manage data, such as a MySQL database. The MySQL database supports various operating systems, including Linux, Windows, macOS, etc., which makes it an ideal choice for cross-platform application development. MySQL provides a range of functions, including transaction processing, subqueries, stored procedures, and triggers, which make MySQL a powerful database system.

[0038] In short, the memory space of the first database is smaller than the content space of the second database. In some embodiments, the first database is mainly used to cache the historical deduction logs, current expense bills, and attribute information of order information fed back by the second database, so that the system can directly query the attribute information of the order information in the first database, and then determine whether the deduction is allowed based on the attribute information of the order information, thereby reducing the phenomenon of random deduction or wrong deduction caused by poor performance due to input and output processing in one database.

[0039] In some embodiments, the first database, such as a Redis database, uses a lightweight scripting language, such as Lua, to implement fee deduction related operations.

[0040] It should be noted that the historical deduction log records the amount of deductions, the amount of traffic deducted, and the time of deduction. Through the historical deduction log, you can obtain information such as the amount of traffic that needs to be traced back to calculate the current traffic or the starting time for calculating the traffic fee, thereby effectively ensuring the accuracy of the traffic fee deduction.

[0041] Step 106: Execute a deduction operation according to the expense bill corresponding to the business traffic.

[0042] It should be noted that in the prior art, the service flow charge system only uses the MySQL database for charge related processing. In this embodiment, the charge events are processed by two databases to reduce system performance problems caused by the concentration of charge requests, and the collaborative processing of the two databases can reduce the charge errors and other problems caused by only one database processing in the prior art, thereby improving the charge processing performance of the service flow charge system.

[0043] In some scenarios, business traffic generally refers to Internet traffic, such as 5G traffic or 4G traffic, or network traffic used by specific software, etc. Usually, the order information of business traffic will include traffic packages or traffic packages, and traffic packages usually also limit the time period or traffic usage, etc. Generally speaking, no deduction is allowed before the traffic package is used up.

[0044] In some embodiments, the attribute information of the order information includes at least one of the following: an order effective time interval and a limited number of copies of the order; Determining, based on the attribute information of the order information, that the usage time interval of the service traffic is within the order effective time interval, then indicating that deduction is not allowed; or According to the attribute information of the order information, it is determined that the number of order information usage corresponding to the order information is within the order limit number of copies, and it is indicated that deduction is not allowed.

[0045] Therefore, the usage time interval of the business traffic queried through the first database is within the order effectiveness time interval. For example, the order effectiveness time interval of the traffic package is 11:00 pm-6:00 am. Then, when the business traffic time interval queried through the first database is within the order effectiveness time interval of the traffic package (for example, 11:00 pm-6:00 am), there is no need to make a deduction request; and when the business traffic time interval queried through the first database is not the order effectiveness time interval of the traffic package, it is necessary to calculate the traffic fee of the business traffic and perform subsequent deduction processing.

[0046] In this embodiment, by querying, for example, the Redis cache to find out whether there is order information related to deduction, if the attribute information of the order information does not meet the conditions, the access to the second database can be reduced, thereby effectively improving the system performance of the deduction system for business traffic.

[0047] In some embodiments, the attribute information of the order information includes: a correspondence between a deduction request identifier and an order number; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: Determining whether the corresponding relationship between the deduction request identifier and the order number is unique according to the corresponding relationship between the deduction request identifier and the order number; If the correspondence between the deduction request identifier and the order number is unique, it indicates that the deduction is allowed.

[0048] It should be noted that here, based on the correspondence between the deduction request identifier and the order number, determining whether the correspondence between the deduction request identifier and the order number is unique can be completed by using only the first database.

[0049] In this way, by verifying whether the correspondence between the deduction request identifier and the order number is unique, repeated verification can be prevented, thereby preventing deduction errors caused by repeated deductions, ensuring that each deduction request is unique, and avoiding repeated deduction problems caused by repeated requests.

[0050] In some embodiments, the method further comprises: Using the third database to receive a query instruction for querying the second database for the business flow corresponding to the order information; If the attribute information of the order information indicates that deduction is allowed, querying the second database for the service flow corresponding to the order information to determine the fee bill corresponding to the service flow includes: If the attribute information of the order information indicates that deduction is allowed, sending a query instruction to the third database; Based on the query instruction, the second database is queried for the business flow corresponding to the order information to determine the expense bill corresponding to the business flow.

[0051] In some embodiments, the method further comprises: If the attribute information of the order information indicates that deduction is allowed, a query instruction for querying the second database for the business flow corresponding to the order information is sent to the third database.

[0052] The third database here can be understood as a distributed messaging middleware and stream computing platform, such as Rocket MQ (hereinafter referred to as RMQ), which is used to handle high-throughput messaging and stream data processing, supports distributed / subscription messaging models, and provides a reliable messaging mechanism. The application of the third database here is mainly to synchronize data between different systems or databases to ensure data consistency and real-time performance.

[0053] In this way, by utilizing the third database to implement asynchronous parallel processing of sending and executing query instructions, the burden on the database is reduced and system performance is improved.

[0054] In order to further understand the embodiments of the present invention, in some embodiments, please refer to Figure 2 ,like Figure 2 As shown, taking the first database as Redis, the second database as Mysql and the third database as RMQ as an example, the technical framework of the service traffic deduction system may include: a deduction module completed by Redis, a data flow middleware completed by RMQ, and a persistence module completed by Mysql; in some embodiments, when RMQ is not available, DB (Database) can be used as a transit to realize XXL Job asynchronous processing with Mysql.

[0055] For details on the deduction process, please refer to Figure 3 ,like Figure 3 As shown, the method includes: start: This is the starting point of the process, where the business traffic deduction system initiates a deduction request in the background; Determine whether the fee deduction switch is turned on: The system checks whether there is a deduction switch mechanism. In some embodiments, the deduction switch mechanism is usually a dynamic configuration item that can thermally control whether the deduction is open or not. By determining whether the deduction switch is turned on, it can be determined whether the current deduction operation is allowed. If the switch is turned off, the process will stop to prevent unnecessary deductions.

[0056] In actual applications, if the fee deduction switch is turned on, the "query Redis" step is executed; if the fee deduction switch is turned off, the external service is responded to.

[0057] Anti-recheck: The system performs anti-duplicate verification to ensure that each deduction request is unique, avoiding duplicate deductions caused by repeated requests.

[0058] In actual application, if the anti-duplicate check detects duplicate deductions, the serial number is responded to for duplicate consumption deductions, where the serial number corresponds to the deduction request identifier; if the anti-duplicate check detects non-duplicate deductions, the "pre-check" step is executed.

[0059] Pre-check: Before executing the deduction operation, the system performs a series of pre-checks, such as verifying whether the order is within the validity period, whether the order quantity is sufficient, and whether the order reaches the limit, to ensure the smooth progress of the deduction operation. If the condition verification is not met, the deduction process will be directly exited and the deduction failure will be returned.

[0060] In actual applications, if the pre-verification indicates that deduction is not allowed, the verification fails and a corresponding error indication is responded to the external service; if the pre-verification indicates that deduction is allowed, the step of "sending event semi-message" is executed.

[0061] Check Redis: The system queries the Redis cache to find out whether there is any information about orders, schools, and users related to deductions, such as: the order validity period, the number of copies used, the number of copies with restrictions on use, the number of copies remaining, etc. By querying Redis, efficiency is improved and direct access to the database is reduced.

[0062] In actual applications, data is searched according to the order number. If found, the step "anti-duplicate verification" is executed; if not found, it is instructed to search the second database, that is, the MySQL database, for search, that is, the subsequent "database search" step is executed. If the data exists, the data will be cached in Redis so that it can be directly searched in Redis later. If the data does not exist, it will respond to external services. In actual applications, Redis will regularly obtain the attribute information of order information from MySQL, or trigger Redis to obtain the attribute information of order information from MySQL after each deduction. Or after each deduction, MySQL will actively send the attribute information of order information to the Redis cache, for example, the historical deduction log of order information is sent to the Redis cache, so that it can be directly searched in Redis at the next deduction request.

[0063] Send event semi-messages and use Lua scripts to deduct fees: If there is information about orders, schools, and users related to deductions in Redis, this data will be sent to, for example, Alibaba Cloud transaction messages to prepare for the next deduction operation.

[0064] In actual applications, for example, when using Rocket MQ to send transaction messages, when Alibaba Cloud's server does not receive active reporting of the local time status, it will actively send a query, and the MQ semi-transaction message will check RMQ, and commit or roll back the transaction according to the specific transaction status. The transaction here actually refers to the query instruction of the deduction event. By caching the query instruction from MQ, the asynchronous operation of the query instruction and query execution can be realized to ensure system performance.

[0065] Check library: The system queries the MySQL database for pay-as-you-go order information, which is a key step in the deduction operation and requires ensuring the validity and accuracy of the order.

[0066] Determine whether the deduction is successful: The system asks whether the deduction operation is executed successfully. If the deduction is successful, the half-message of the transaction is committed; if the deduction fails, the Roolback operation is executed to invalidate the half-message.

[0067] In actual applications, if the deduction is successful, the subsequent steps of "deduction results, asynchronous consumption of MQ" are executed.

[0068] Responding to external services: Regardless of whether the deduction operation is successful, the system needs to send a response to the external service that initiated the request to inform them of the result of the deduction.

[0069] Deduction results, asynchronous consumption MQ: The end point of the process indicates that the deduction operation has been completed and whether the subsequent MQ consumption guarantees the data consistency between the cache and the DB.

[0070] In actual applications, updating consumption MQ such as order deduction logs to the DB and inserting log accounts actually means updating the deduction logs and synchronizing the deduction logs to MySQL so that Redis can query the database to update the attribute information of the order information, thereby ensuring data consistency and accuracy of deductions, and improving the system performance of the deduction system for business traffic.

[0071] In this way, by using the first database such as Redis as a cache and utilizing a lightweight scripting language such as Lua script, fast deductions can be achieved; through RMQ transaction messages, the transactionality of the overall deduction is achieved, and the final consistency of the data is ensured by consuming MQ.

[0072] To achieve the above purpose, the embodiment of the present invention also provides a service flow fee deduction device, which is applied to a computer device, see Figure 4 , the device comprises: A first receiving module 41 is used to receive a charge deduction request for service traffic; A first determining module 42, configured to determine order information associated with the deduction request based on the deduction request; A first query module 43, configured to query attribute information of the order information in a first database according to the order information; A second determination module 44 is used to determine whether the attribute information of the order information indicates that deduction is allowed according to the attribute information of the order information; A second query module 45 is configured to query a second database for the business flow corresponding to the order information to determine a fee bill corresponding to the business flow if the attribute information of the order information indicates that deduction is allowed; wherein the memory space of the first database is smaller than the memory space of the second database; The execution module 46 is used to execute a deduction operation according to the fee bill corresponding to the business flow.

[0073] In some embodiments, the apparatus further comprises: A third determination module is used to determine whether the deduction operation is successful; A feedback and recording module, configured to feedback the result of successful deduction to the second database if the deduction is successful, and record the deduction log of the order information; The first determining module 42 is further configured to: If the attribute information of the order information indicates that deduction is allowed, the current fee bill corresponding to the current business traffic is determined based on the historical deduction log corresponding to the order information.

[0074] In some embodiments, the apparatus further comprises: A feedback module, configured to feed back the deduction log to the first database if the deduction is successful; The first query module 43 is further used for: According to the order information, querying the first database for a deduction log of the order information; Determine attribute information of the order information according to the deduction log of the order information.

[0075] In some embodiments, the attribute information of the order information includes at least one of the following: an order effective time interval and a limited number of copies of the order; The second determining module 44 is further configured to: According to the attribute information of the order information, it is determined that the usage time interval of the service traffic is within the order effective time interval, and it is indicated that the deduction is not allowed; or According to the attribute information of the order information, it is determined that the number of order usage corresponding to the order information is within the order limit number, and it is indicated that deduction is not allowed.

[0076] In some embodiments, the attribute information of the order information includes: a correspondence between a deduction request identifier and an order number; The second determining module 44 is further configured to: Determining whether the corresponding relationship between the deduction request identifier and the order number is unique according to the corresponding relationship between the deduction request identifier and the order number; If the correspondence between the deduction request identifier and the order number is unique, it indicates that the deduction is allowed.

[0077] In some embodiments, the apparatus further comprises: A second receiving module, used to use the third database to receive a query instruction for querying the second database for the business flow corresponding to the order information; The first query module 43 is further used for: If the attribute information of the order information indicates that deduction is allowed, sending a query instruction to the third database; Based on the query instruction, the second database is queried for the business flow corresponding to the order information to determine the expense bill corresponding to the business flow.

[0078] In some embodiments, the apparatus further comprises: A sending module is used to send a query instruction to the third database to query the second database for the business flow corresponding to the order information if the attribute information of the order information indicates that deduction is allowed.

[0079] It should be noted here that the description of the above data security operation device item is similar to the description of the above data security operation method item, and the description of the beneficial effects of the same method is not repeated. For technical details not disclosed in the data security operation device embodiment of the present invention, please refer to the description of the data security operation method embodiment of the present invention.

[0080] To achieve the above object, an embodiment of the present invention further provides a computer device, such as Figure 5 As shown, the computer device includes a processor 501 and a memory 503 connected to the processor 501 via a communication bus 502; wherein the memory 503 is used for a data scanning program; the processor 501 is used to execute the data security operation program to implement the steps of the method for deducting business traffic applied to an endpoint device in any of the above schemes: receiving a deduction request for business traffic; determining order information associated with the deduction request based on the deduction request; querying attribute information of the order information in a first database according to the order information; determining whether the attribute information of the order information indicates that deduction is allowed according to the attribute information of the order information; if the attribute information of the order information indicates that deduction is allowed, querying the business traffic corresponding to the order information in a second database to determine the fee bill corresponding to the business traffic; wherein the memory space of the first database is smaller than the memory space of the second database; and performing a deduction operation according to the fee bill corresponding to the business traffic.

[0081] Here, the processor 501 is used to execute the deduction procedure of the service flow to achieve the following: determine whether the deduction operation is successful; If the deduction is successful, the result of the successful deduction is fed back to the second database, and a deduction log of the order information is recorded; If the attribute information of the order information indicates that deduction is allowed, the current fee bill corresponding to the current business traffic is determined based on the historical deduction log corresponding to the order information.

[0082] Here, the processor 501 is used to execute the fee deduction program of the service flow to achieve the following: If the deduction is successful, the deduction log is fed back to the first database; According to the order information, querying the first database for a deduction log of the order information; Determine attribute information of the order information according to the deduction log of the order information.

[0083] Here, the attribute information of the order information includes at least one of the following: an order effective time interval and a limited number of order copies; the processor 501 is used to execute the deduction procedure of the business traffic to achieve the following: According to the attribute information of the order information, it is determined that the usage time interval of the service traffic is within the order effective time interval, and it is indicated that the deduction is not allowed; or According to the attribute information of the order information, it is determined that the number of order usage corresponding to the order information is within the order limit number, and it is indicated that deduction is not allowed.

[0084] Here, the attribute information of the order information includes: a correspondence between a charge request identifier and an order number; the processor 501 is used to execute the charge deduction program of the service flow to achieve the following: Determining whether the corresponding relationship between the deduction request identifier and the order number is unique according to the corresponding relationship between the deduction request identifier and the order number; If the correspondence between the deduction request identifier and the order number is unique, it indicates that the deduction is allowed.

[0085] Here, the attribute information of the order information includes: a correspondence between a charge request identifier and an order number; the processor 501 is used to execute the charge deduction program of the service flow to achieve the following: Using the third database to receive a query instruction for querying the second database for the business flow corresponding to the order information; If the attribute information of the order information indicates that deduction is allowed, sending a query instruction to the third database; Based on the query instruction, the second database is queried for the business flow corresponding to the order information to determine the expense bill corresponding to the business flow.

[0086] Here, the attribute information of the order information includes: a correspondence between a charge request identifier and an order number; the processor 501 is used to execute the charge deduction program of the service flow to achieve the following: If the attribute information of the order information indicates that deduction is allowed, a query instruction for querying the second database for the business flow corresponding to the order information is sent to the third database.

[0087] Optionally, the processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Here, the program executed by the processor 501 may be stored in a memory 503 connected to the processor 501 via a communication bus 502, and the memory 503 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache.By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct RAM bus random access memory (DRRAM). The memory 503 described in the embodiment of the present invention is intended to include but is not limited to these and any other suitable types of memory 503. The memory 503 in the embodiment of the present invention is used to store various types of data to support the operation of the processor 501. Examples of such data include: any computer program operated by the processor 501, such as an operating system and application programs; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks.

[0088] In some embodiments, the memory 502 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM). The memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0089] The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor are combined to be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0090] In some embodiments, the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0091] For software implementation, the techniques described herein can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0092] Another embodiment of the present invention provides a computer storage medium, which stores an executable program. When the executable program is executed by the processor 501, the steps of the method for charging the service traffic applied to the endpoint device or server can be implemented. Figure 1 or Figure 2 or Figure 3 One or more of the methods shown.

[0093] In some embodiments, the computer storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0094] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.

[0095] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.

Claims

1. A service flow fee deduction method, characterized in that: include: A charge request for service traffic is received; Based on the deduction request, determining order information associated with the deduction request; According to the order information, querying the first database for attribute information of the order information; Determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed; If the attribute information of the order information indicates that deduction is allowed, querying the service flow corresponding to the order information from the second database to determine the fee bill corresponding to the service flow; wherein the memory space of the first database is smaller than the memory space of the second database; The deduction operation is performed according to the fee bill corresponding to the business flow.

2. The method according to claim 1, characterized in that The method further comprises: Determine whether the deduction operation is successful; If the deduction is successful, the result of the successful deduction is fed back to the second database, and a deduction log of the order information is recorded; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: If the attribute information of the order information indicates that deduction is allowed, the current fee bill corresponding to the current business traffic is determined based on the historical deduction log corresponding to the order information.

3. The method according to claim 2, characterized in that The method further comprises: If the deduction is successful, the deduction log is fed back to the first database; The querying the first database for attribute information of the order information according to the order information includes: According to the order information, querying the first database for a deduction log of the order information; Determine attribute information of the order information according to the deduction log of the order information.

4. The method according to claim 3, characterized in that The attribute information of the order information includes at least one of the following: the order effective time interval and the order limit number of copies; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: According to the attribute information of the order information, it is determined that the usage time interval of the service traffic is within the order effective time interval, and it is indicated that the deduction is not allowed; or According to the attribute information of the order information, it is determined that the number of order usage corresponding to the order information is within the order limit number, and it is indicated that deduction is not allowed.

5. The method according to claim 3, characterized in that: The attribute information of the order information includes: the correspondence between the deduction request identifier and the order number; The determining, according to the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed includes: Determining whether the corresponding relationship between the deduction request identifier and the order number is unique according to the corresponding relationship between the deduction request identifier and the order number; If the correspondence between the deduction request identifier and the order number is unique, it indicates that the deduction is allowed.

6. The method according to claim 1, characterized in that The method further comprises: Using the third database to receive a query instruction for querying the second database for the business flow corresponding to the order information; If the attribute information of the order information indicates that deduction is allowed, querying the second database for the service flow corresponding to the order information to determine the fee bill corresponding to the service flow includes: If the attribute information of the order information indicates that deduction is allowed, sending a query instruction to the third database; Based on the query instruction, the second database is queried for the business flow corresponding to the order information to determine the expense bill corresponding to the business flow.

7. The method according to claim 1, characterized in that The method further comprises: If the attribute information of the order information indicates that deduction is allowed, a query instruction for querying the second database for the business flow corresponding to the order information is sent to the third database.

8. A service flow fee deduction device, characterized in that: include: A first receiving module, configured to receive a charge deduction request for service traffic; A first determining module, configured to determine order information associated with the deduction request based on the deduction request; A first query module, configured to query attribute information of the order information in a first database according to the order information; A second determination module, configured to determine, based on the attribute information of the order information, whether the attribute information of the order information indicates that deduction is allowed; A second query module is used to query the service flow corresponding to the order information from a second database to determine the fee bill corresponding to the service flow if the attribute information of the order information indicates that deduction is allowed; wherein the memory space of the first database is smaller than the memory space of the second database; The execution module is used to execute the deduction operation according to the fee bill corresponding to the business flow.

9. A computer device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is used to execute the service traffic fee deduction method as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to enable the one or more processors to implement the method for deducting fees for business traffic as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Service charging method, device and equipment and storage medium

    CN110233741A

  • Charging method, device and system

    CN110349281A

  • A method for service application accessing the charging system, a charging engine and charging network thereof

    WO2007014533A1