Call record processing method, device and equipment and storage medium
By caching billing information into a cache resource pool, processing call detail records (CDRs) one by one, and submitting the billing information uniformly, the problem of high system load in CDR processing is solved, and efficient batch billing processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP ZHEJIANG
- Filing Date
- 2023-09-22
- Publication Date
- 2026-04-28
AI Technical Summary
The existing call detail record (CDR) processing method involves frequent interactions with the database, resulting in high system load and low processing efficiency.
By caching billing information to a pre-defined cache resource pool, billing is processed for each transaction ticket individually, and the billing information is submitted to the billing database after processing, reducing the number of interactions with the database.
This reduced system load, improved call detail record (CDR) processing efficiency, and decreased interaction time.
Smart Images

Figure CN118803623B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a call detail record (CDR) processing method, apparatus, device, and storage medium. Background Technology
[0002] With the continuous development of communication services, call detail records (CDRs) are growing massively, and it's becoming increasingly common for users to use multiple services within a given period. For example, users may switch between multiple application scenarios such as playing games, watching videos, and listening to music within a short timeframe. Each service scenario corresponds to a different service code, and a single CDR record generated by the network side may contain multiple service codes. The billing system needs to set different billing rules according to different service scenarios. Existing technical solutions require connecting to the billing database for each service code within a single CDR for billing purposes.
[0003] Specifically, for cases where multiple services are encapsulated in a single call detail record (CDR), billing requires splitting the single data traffic CDR into multiple entries based on different service codes. Except for the service code field, uplink / downlink traffic fields, and time field values, all other fields are copied from the original input CDR fields. Each of the split CDR entries contains only one service code. For each CDR, billing needs to be performed by connecting to the billing system's billing database (MDB), thereby enabling the calculation of free resources and costs for an individual service code and updating the billing database (MDB).
[0004] The massive amounts of call detail records (CDRs) generated by the rapid development of the internet pose a serious challenge to the timeliness of routine CDR processing in billing systems. Current CDR processing methods involve frequent interactions between the billing system and the database, resulting in high system load. For example, for a CDR containing two RG services, batch pricing calculation requires eight interactions with the in-memory database. According to statistics, the database interaction process accounts for the largest portion of the overall batch pricing processing time, exceeding 50%. For multiple CDR records with single service codes obtained through service decomposition, the calculation process consumes considerable time for each database query, lock, update, and unlock operation, leading to extremely low CDR processing efficiency. Summary of the Invention
[0005] This application provides a call detail record (CDR) processing method, apparatus, device, and storage medium to solve the technical problems of existing CDR processing methods involving frequent database interactions, high system load, and low CDR processing efficiency.
[0006] In a first aspect, embodiments of this application provide a call detail record (CDR) processing method, including:
[0007] The system acquires call detail records (CDRs) to be processed and queries the pre-designed fee database for the corresponding billing information; the billing information includes billing rules and resource information.
[0008] The billing information is cached in a preset cache resource pool, and the call detail records (CDRs) in the call detail record (CDR) data are billed one by one based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool.
[0009] After the call detail record (CDR) data has been processed for billing, the cached billing information is submitted to the billing database to update the billing database.
[0010] In one embodiment, the billing process for each call detail record (CDR) in the CDR data based on cached billing information, obtaining the tariff information for each CDR in the CDR data and caching it in the cache resource pool, includes:
[0011] Based on the service identifier of each call detail record (CDR) in the CDR data, the CDR data is converted into a CDR list;
[0012] Obtain the target call detail record (CDR) from the CDR list, and obtain the target billing information corresponding to the target CDR from the cached billing information;
[0013] The target call detail record (CDR) is billed according to the target billing information to obtain the tariff information of the target CDR, and the tariff information of the target CDR is cached in the cache resource pool.
[0014] If the target call detail record (CDR) is not the last CDR in the CDR list, then return and execute the step of obtaining the target CDR from the CDR list until the target CDR is the last CDR in the CDR list.
[0015] In one embodiment, when the target call detail record (CDR) includes multiple service identifiers, the target billing information includes billing sub-information corresponding to each service identifier; the step of performing billing processing on the target CDR based on the target billing information to obtain the tariff information of the target CDR, and caching the tariff information of the target CDR in the cache resource pool includes:
[0016] Based on each service identifier in the target call detail record (CDR), obtain the CDR list corresponding to the target CDR;
[0017] Obtain the target service identifier from the call detail record (CDR) sublist, and obtain the billing sub-information corresponding to the target service identifier from the target billing information; the target service identifier can be any one of the CDRs in the CDR list.
[0018] Billing processing is performed on the target service corresponding to the target service identifier in the target call detail record based on the billing sub-information to obtain the tariff information corresponding to the target service identifier, and the tariff information corresponding to the target service identifier is cached in the cache resource pool;
[0019] Return and execute the step of obtaining the target service identifier in the call detail record (CDR) sublist until the target service identifier is the last one in the CDR list.
[0020] In one embodiment, retrieving the billing information corresponding to the call detail record (CDR) data from the pre-designed fee database includes:
[0021] Extract user information from the call detail record (CDR) data; the user information includes user identifier and service identifier.
[0022] Based on the user information, the billing information corresponding to the call detail record (CDR) data is retrieved from a preset billing database.
[0023] In one embodiment, retrieving the billing information corresponding to the call detail record (CDR) data from a preset billing database based on the user information includes:
[0024] Based on the user information, the call detail records (CDRs) corresponding to the same user in the call detail record (CDR) data are merged to remove duplicates of the user information;
[0025] Based on the deduplicated user information, the billing information corresponding to the call detail record (CDR) data is queried from the preset billing database.
[0026] In one embodiment, submitting the cached pricing information to the billing database and updating the billing database includes:
[0027] The cached pricing information is submitted to the billing database, and the pricing information is divided according to the user identifier in the user information;
[0028] Based on the tariff information of the same user after segmentation, the billing database is updated according to the service identifier in the user information.
[0029] In one embodiment, after submitting the cached pricing information to the billing database and updating the billing database, the method further includes:
[0030] The tariff information and the billing information are cleared to release the memory space occupied by the tariff information and the billing information in the cache resource pool.
[0031] Secondly, embodiments of this application provide a call detail record (CDR) processing apparatus, comprising:
[0032] The query module is used to obtain call detail records (CDRs) to be processed and to query the billing information corresponding to the CDRs from the pre-designed fee database; the billing information includes billing rules and resource information.
[0033] The caching module is used to cache the billing information into a preset cache resource pool, and to perform billing processing on each call detail record (CDR) in the call detail record (CDR) data based on the cached billing information, so as to obtain the tariff information of each CDR in the CDR data and cache it into the cache resource pool.
[0034] The update module is used to submit the cached tariff information to the billing database after the billing process in the call detail record (CDR) data is completed, thereby updating the billing database.
[0035] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the call detail record (CDR) processing method described in the first aspect.
[0036] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the call detail record (CDR) processing method described in the first aspect.
[0037] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the call detail record (CDR) processing method described in the first aspect.
[0038] The call detail record (CDR) processing method, apparatus, device, and storage medium provided in this application acquire CDR data to be processed and query the corresponding billing information from a pre-designed billing database, caching it in a preset cache resource pool. Based on the cached billing information, billing is processed for each CDR in the CDR data, obtaining the tariff information for each CDR and caching it in the cache resource pool. After the CDR billing processing in the CDR data is completed, the cached tariff information is submitted to the billing database to update the billing database. By caching billing and tariff information in the cache resource pool, batch billing processing of CDR data is achieved, reducing the number of interactions with the billing database, reducing system load, and reducing the interaction time for batch billing of CDR data, thereby improving the processing efficiency of CDR data. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is one of the flowcharts illustrating the call detail record (CDR) processing method provided in the embodiments of this application;
[0041] Figure 2 This is a schematic diagram of the architecture of the cache resource pool provided in an embodiment of this application;
[0042] Figure 3 This is a second flowchart illustrating the call detail record (CDR) processing method provided in this application embodiment;
[0043] Figure 4 This is a schematic diagram of the interaction process of the call detail record (CDR) processing flow provided in the embodiments of this application;
[0044] Figure 5 This is a schematic diagram of the call detail record (CDR) processing device provided in the embodiments of this application;
[0045] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] Figure 1 This is a flowchart illustrating the call detail record (CDR) processing method provided in an embodiment of this application. (Refer to...) Figure 1 The call detail record (CDR) processing method provided in this application can be applied to a billing system. The billing system corresponds to a billing database (MDB), also known as a billing database. The method may include:
[0048] Step 100: Obtain the call detail record (CDR) data to be processed, and query the billing information corresponding to the CDR data from the pre-designed fee database; the billing information includes billing rules and resource information;
[0049] First, the call detail records (CDRs) to be processed are obtained. This CDR data includes one or more CDR records. The billing information corresponding to the CDR data is then retrieved from the pre-defined billing database (MDB). This billing information is necessary for billing the CDR data, including billing rules and resource information. Resource information includes the available resources, total resources, and remaining resources for each user corresponding to each CDR. The query for billing information corresponding to the CDR data is a batch query of the billing information for each CDR within the CDR data, reducing the number of interactions between different CDRs and the database for individual queries.
[0050] It should be noted that a single user can have one or more call detail records (CDRs), and a single CDR can contain one or more service identifiers. Different service identifiers correspond to different service scenarios, and different service scenarios may correspond to different billing rules. Therefore, the obtained billing information includes the billing information of each CDR in the CDR data. For CDRs containing multiple service identifiers, the billing information of the CDR includes the billing information corresponding to each service identifier.
[0051] Step 200: Cache the billing information into a preset cache resource pool, and perform billing processing on each call detail record (CDR) in the call detail record (CDR) data based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it into the cache resource pool.
[0052] After obtaining the billing information corresponding to the call detail records (CDRs) to be processed, the obtained billing information is cached in a preset cache resource pool. Based on the cached billing information, each CDR in the CDR data is billed one by one to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool.
[0053] In existing call detail record (CDR) processing methods, CDRs containing multiple service identifiers need to be split into multiple CDRs containing a single service identifier, and billing needs to be performed on each CDR separately. Each CDR requires interaction with the database during billing. However, in this embodiment, by caching billing information in a cache resource pool, for different CDRs, the cached billing information is queried in batches. When processing billing for a CDR, only the cached billing information needs to be queried from the cache resource pool, eliminating the need for database interaction. This reduces database interaction and improves CDR processing efficiency.
[0054] Furthermore, caching the pricing information obtained from billing processing of call detail records (CDRs) data facilitates batch billing processing of CDRs. Batch pricing of each CDR within the CDR data can be processed in parallel or sequentially according to priority. In sequential processing, the priority order can be determined based on the CDR's creation time; CDRs created earlier have higher priority than those created later, i.e., following the first-to-first-process principle. In this embodiment, for CDRs containing multiple service identifiers, pricing can be performed sequentially, querying the cached billing information for each identifier and caching the corresponding pricing information. During this process, the CDR can be split into multiple CDRs with single service identifiers, or the CDRs can be split without splitting them; no specific limitation is made here.
[0055] Step 300: After the call detail record (CDR) billing process in the CDR data is completed, the cached tariff information is submitted to the billing database to update the billing database.
[0056] After the billing of each call detail record (CDR) in the call detail record (CDR) data is completed, the cached billing information of each CDR is submitted to the billing database (MDB) to update the billing database and complete the batch pricing of the CDR data. In existing CDR data processing methods, for each CDR, both querying billing information and submitting the billing information obtained after billing processing require interaction with the database. By caching billing and billing information through a cache resource pool, batch pricing of CDR data can be achieved. After the pricing of each CDR in the CDR data is completed, it is submitted to the database uniformly. For batch pricing of multiple CDRs, only two interactions with the database are required: querying billing information and submitting billing information. This reduces the number of interactions with the database, thereby reducing system load and improving the processing efficiency of CDRs.
[0057] Optionally, refer to Figure 2 The diagram shown illustrates the architecture of the cache resource pool. Figure 2 In this system, the cache resource pool comprises an interface application layer, a business interface layer, a billing database (MDB) layer, and a data storage layer. The interface application layer handles IPC and TCP communication and business processing between business applications; the business interface layer provides access interfaces for each business application; the billing database (MDB) layer provides capabilities such as daemon threads, concurrency management, recovery processing, dual-machine cluster HA mechanisms, transaction management, and data management, as well as Redo and ACK message responses; the data storage layer persistently stores Redo log files and memory data image files; and the system management layer provides capabilities such as authentication management, system monitoring, access management, and file management. Figure 2The system architecture shown has a cache resource pool with relatively independent system functions, and it can interact with other business applications to meet the billing system's batch pricing requirements for transaction data.
[0058] In this embodiment, call detail record (CDR) data to be processed is acquired, and the corresponding billing information is retrieved from a pre-designed billing database and cached in a preset cache resource pool. Based on the cached billing information, billing is processed for each CDR in the CDR data, obtaining the tariff information for each CDR and caching it in the cache resource pool. After the CDR billing processing in the CDR data is completed, the cached tariff information is submitted to the billing database to update the billing database. By caching billing and tariff information in the cache resource pool, batch billing processing of CDR data is achieved, reducing the number of interactions with the billing database, reducing system load, and reducing the interaction time for batch billing of CDR data, thereby improving the processing efficiency of CDR data.
[0059] Preferably, the batch pricing processing of call detail record (CDR) data is based on a list. Specifically, in step 200, based on cached billing information, each CDR in the CDR data is billed one by one to obtain the tariff information of each CDR and cache it in the cache resource pool. This may also include:
[0060] Step 201: Based on the service identifier of each call detail record (CDR) in the CDR data, convert the CDR data into a CDR list;
[0061] Step 202: Obtain the target call detail record (CDR) from the CDR list and obtain the target billing information corresponding to the target CDR from the cached billing information;
[0062] Step 203: Perform billing processing on the target call detail record (CDR) according to the target billing information to obtain the tariff information of the target CDR, and cache the tariff information of the target CDR in the cache resource pool;
[0063] Step 204: If the target call detail record (CDR) is not the last CDR in the CDR list, then return and execute the step of obtaining the target CDR from the CDR list until the target CDR is the last CDR in the CDR list.
[0064] Based on the service identifiers of each call detail record (CDR) in the CDR data, the CDR data is transformed into a CDR list. The target CDR is then retrieved from this list, and its target billing information is obtained from the cached billing information. Billing processing is performed on the target CDR based on this target billing information to obtain its corresponding tariff information, which is then cached in a cache resource pool. If the target CDR is not the last one in the CDR list (i.e., not the last CDR in the list), a new CDR is retrieved from the list as the target CDR, and the above steps are repeated until the retrieved target CDR is the last CDR in the list. This completes the billing output for each CDR in the CDR list, obtaining the cached tariff information for each CDR in the CDR data.
[0065] Furthermore, a call detail record (CDR) may include one or more service identifiers. When the target CDR includes multiple service identifiers, the generated CDR list includes a CDR sublist corresponding to each service identifier of the target CDR. Different service identifiers may have different billing rules; therefore, the target billing information of the target CDR includes the billing sub-information corresponding to each service identifier. Based on this, in step 203, billing processing is performed on the target CDR according to the target billing information to obtain the tariff information of the target CDR. The tariff information of the target CDR is then cached in the cache resource pool, specifically including:
[0066] Step 2031: Based on each service identifier in the target call detail record (CDR), obtain the CDR sublist corresponding to the target CDR;
[0067] Step 2032: Obtain the target service identifier from the call detail record (CDR) sublist, and obtain the billing sub-information corresponding to the target service identifier from the target billing information; the target service identifier is any one of the CDRs in the CDR list;
[0068] Step 2033: Perform billing processing on the target service corresponding to the target service identifier in the target call detail record according to the billing sub-information to obtain the tariff information corresponding to the target service identifier, and cache the tariff information corresponding to the target service identifier in the cache resource pool;
[0069] Step 2034: Return to and execute the step of obtaining the target service identifier in the call detail record (CDR) sublist until the target service identifier is the last one in the CDR sublist.
[0070] First, based on the service identifiers in the target call detail record (CDR), a sub-list of CDRs corresponding to the target CDR is obtained. This sub-list can be generated based on the target CDR or extracted from a list of CDRs; no specific limitation is made here. Next, the target service identifier is obtained from the sub-list of CDRs, and the corresponding billing sub-information is obtained from the target billing information. The target service identifier is any one of the service identifiers in the target CDR, i.e., any one of the service identifiers in the sub-list of CDRs. Based on the obtained billing sub-information, billing processing is performed on the target service corresponding to the target service identifier in the target CDR to obtain the tariff information corresponding to the target service identifier. This tariff information corresponding to the target service identifier is then cached in a cache resource pool.
[0071] Determine if the target service identifier is the last one in the call detail record (CDR) sublist. If not, retrieve a new service identifier from the CDR sublist as the target service identifier and repeat the above processing steps for the target service identifier until the retrieved target service identifier is the last one in the CDR list.
[0072] Preferably, refer to Figure 3 The diagram shown illustrates the call detail record (CDR) processing flow. When querying the billing information corresponding to the CDR data from the billing database, it can be based on the first CDR in the CDR data. When the first CDR in the CDR data is detected, the query for the billing information corresponding to the CDR data is triggered.
[0073] Specifically, such as Figure 3 As shown, the XDRLIST, a call detail record (CDR) list generated based on call detail record (CDR) data, retrieves a CDR for processing. For each CDR retrieved, during processing, it first determines whether it is the first CDR. If it is the first CDR, it queries the billing database to retrieve the corresponding billing information and caches it. If it is not the first CDR, it queries the cached billing information, performs standard batch pricing, and caches the obtained tariff information to update the cached information. Then, it determines whether the CDR is the last CDR. If it is the last CDR, it means that the batch pricing of all CDRs in the CDR data has been completed, and the cached tariff information is submitted to the billing database to update the billing database, completing the batch pricing of the CDR data. If it is not the last CDR, a new CDR is retrieved from the XDRLIST for processing.
[0074] Understandable, Figure 3 The call detail record (CDR) processing flow shown is applicable to CDR data containing multiple CDRs, and also applicable to CDR data containing one CDR containing multiple service identifiers. When used for one CDR containing multiple service identifiers, the CDR list XDRLIST is a list generated based on each service identifier in the CDR.
[0075] Preferably, when processing a call detail record (CDR) containing multiple service identifiers, CDR splitting and cloning are no longer performed; instead, the process is executed in list form. First, based on the order of the service identifiers in the CDR, a list XDRLIST is formed in the calculation service process. When processing the first service identifier of the CDR, the billing database (MDB) is queried to obtain billing information. The returned billing information, including the user's free resource allowance, total traffic, and billing rules, is cached in the process's cache resource pool, MDB-CACHE. The resource allowance and cost (standard pricing) calculated in the process are also cached and updated in MDB-CACHE. The process iterates through the service identifiers in the XDRLIST, updating the calculation results of the corresponding service identifiers in MDB-CACHE. This continues until the calculation result of the last service identifier is updated in MDB-CACHE, at which point the calculation results of all service identifiers are submitted to the billing database (MDB).
[0076] Furthermore, referring to Figure 4 The diagram illustrates the interaction process of call detail record (CDR) data processing. For a CDR containing two RG services, the CDR processing method provided in this embodiment only requires two interactions with the billing database: a billing information query during the initial CDR processing and a submission of tariff information upon completion of the pricing process. This transforms the interaction with the billing database (MDB) during the pricing process into a query and update of cached information. In contrast, existing CDR processing methods... Figure 4 Both querying and updating the cache resource pool require interaction with the billing database. Therefore, by caching billing and tariff information, for a call detail record (CDR) containing two RG services, six interactions with the billing database MDB can be reduced. In other words, by adding a cache resource pool MDB-Cache between the pricing and billing database MDB, in the same CDR processing scenario, interaction with the billing database MDB is only required during the first authentication packet (RG1 UT) query and the last packet (RG2 UU) update. The intermediate six packets are all interactions with the cache resource pool MDB-Cache, reducing the interaction with the billing database MDB by 6 / 8.
[0077] Preferably, in step 100, querying the billing information corresponding to the call detail record (CDR) data from the pre-designed fee database (MDB) specifically includes:
[0078] Step 101: Extract user information from the call detail record (CDR) data; the user information includes user identifier and service identifier;
[0079] Step 102: Query the billing information corresponding to the call detail record (CDR) data from the preset billing database based on the user information.
[0080] Extract user information from each call detail record (CDR) data. This user information includes user identifier and service identifier. Based on the user information, query the billing information corresponding to the CDR data from the preset billing database MDB, that is, query the billing information corresponding to each user identifier and service identifier.
[0081] Furthermore, in step 102, when querying the billing information corresponding to the call detail record (CDR) data from the pre-designed fee database (MDB) based on the extracted user information, the process may further include:
[0082] Step 1021: Merge the call detail records (CDRs) corresponding to the same user in the call detail record data according to the user information, so as to remove duplicates from the user information;
[0083] Step 1022: Based on the deduplicated user information, query the billing information corresponding to the call detail record data from the preset billing database.
[0084] It is known that a single user can correspond to one or more call detail records (CDRs), and a single CDR can also contain one or more service identifiers. For a single CDR containing multiple service identifiers, when it is split and cloned into multiple CDRs each containing a single service identifier, the billing information required for pricing in the resulting CDRs is identical, including data on data, tariffs, and assets. Similarly, the billing information required for different CDRs of the same user is also the same. Therefore, when querying billing information, for multiple CDRs corresponding to the same user, the billing information required for pricing is the same, including the user's billing information under different service scenarios.
[0085] When the acquired call detail records (CDRs) contain multiple CDRs for the same user, the billing information is queried by first merging the CDRs corresponding to the same user based on the extracted user information, thus deduplicating the user information. Based on the deduplicated user information, the billing information corresponding to each user in the pre-defined billing database (MDB) is then queried. In this embodiment, since the billing information required for the same user's CDRs is identical during billing approval, merging the CDRs for the same user to deduplicate them avoids repeated queries for the same user's billing information in the MDB, thereby further reducing data query time and the interaction time during the query phase.
[0086] Furthermore, when multiple call detail records (CDRs) for the same user require billing and pricing approval, only one query request is made to the in-memory database, and the interaction result is stored in a local cache copy of the billing service pricing. The billing resources and information that need to be updated for each CDR are directly updated in the local cache copy. After a pricing process is completed, the pricing information obtained from the local cache copy is synchronized and uniformly submitted to the server-side in-memory database, while the storage space of the local cache copy is released.
[0087] Furthermore, step 300, which involves submitting the cached tariff information to the billing database and updating the billing database, also includes:
[0088] Step 301: Submit the cached tariff information to the billing database, and classify the tariff information according to the user identifier in the user information;
[0089] Step 302: Based on the tariff information of the same user after segmentation, update the billing database according to the service identifier in the user information.
[0090] When submitting cached pricing information to the billing database MDB and updating the billing database MDB, the pricing information is first divided according to the user identifier. The pricing information of different users is distinguished according to different user identifiers. Based on the pricing information of the same user after division, the information is submitted according to the business identifier, thereby updating the pricing information of the same user in different business scenarios.
[0091] It is known that pricing information in different business scenarios can also be divided according to business identifiers. Based on the pricing information in the same business scenario after division, the pricing information of different users in the same business scenario can be updated according to the user identifier.
[0092] Furthermore, in step 300, after submitting the cached tariff information to the billing database and updating the billing database, the process may further include:
[0093] Step 400: Clear the tariff information and the billing information to release the memory space occupied by the tariff information and the billing information in the cache resource pool.
[0094] Clear the cached tariff and billing information and release the memory space occupied by the tariff and billing information in the cache resource pool.
[0095] In this embodiment, based on the cache pool, the data from the billing database MDB server is queried once and cached in the process. Billing is performed according to the service identifier, traffic, time, etc. in the list, achieving the effect of accelerating the processing of call detail records (CDRs). This caching method enables the billing system to quickly process CDRs and reduce the number of interactions with the server.
[0096] Furthermore, for call detail records (CDRs) containing multiple service identifiers, CDR cloning is unnecessary. Instead, the billing MDB query results and update records are first stored in a cache resource pool. After CDR data processing is complete, the billing MDB is updated uniformly in one go. This reduces storage read / write operations during CDR cloning, minimizes the number of database read / write operations, lowers system resource overhead, and reduces host resource usage. Based on this caching strategy, resource utilization can be significantly improved, hardware costs reduced, and the ability to meet the increasing processing demands of CDR data with existing hardware resources can be ensured, thereby improving the quality and efficiency of CDR processing.
[0097] The call detail record (CDR) processing apparatus provided in the embodiments of this application is described below. The CDR processing apparatus described below can be referred to in correspondence with the CDR processing method described above.
[0098] Reference Figure 5 The call detail record (CDR) processing device provided in this application includes:
[0099] The query module 10 is used to obtain call detail records (CDRs) to be processed and to query the billing information corresponding to the CDRs from the pre-designed fee database; the billing information includes billing rules and resource information.
[0100] The caching module 20 is used to cache the billing information into a preset cache resource pool, and to perform billing processing on each call detail record (CDR) in the call detail record (CDR) data based on the cached billing information, so as to obtain the tariff information of each CDR in the CDR data and cache it into the cache resource pool.
[0101] The update module 30 is used to submit the cached tariff information to the billing database after the billing process in the call detail record data is completed, and to update the billing database.
[0102] In one embodiment, the cache module 20 is further configured to:
[0103] Based on the service identifier of each call detail record (CDR) in the CDR data, the CDR data is converted into a CDR list;
[0104] Obtain the target call detail record (CDR) from the CDR list, and obtain the target billing information corresponding to the target CDR from the cached billing information;
[0105] The target call detail record (CDR) is billed according to the target billing information to obtain the tariff information of the target CDR, and the tariff information of the target CDR is cached in the cache resource pool.
[0106] If the target call detail record (CDR) is not the last CDR in the CDR list, then return and execute the step of obtaining the target CDR from the CDR list until the target CDR is the last CDR in the CDR list.
[0107] In one embodiment, when the target call detail record (CDR) includes multiple service identifiers, the target billing information includes billing sub-information corresponding to each service identifier; the caching module 20 is further configured to:
[0108] Based on each service identifier in the target call detail record (CDR), obtain the CDR list corresponding to the target CDR;
[0109] Obtain the target service identifier from the call detail record (CDR) sublist, and obtain the billing sub-information corresponding to the target service identifier from the target billing information; the target service identifier can be any one of the CDRs in the CDR list.
[0110] Billing processing is performed on the target service corresponding to the target service identifier in the target call detail record based on the billing sub-information to obtain the tariff information corresponding to the target service identifier, and the tariff information corresponding to the target service identifier is cached in the cache resource pool;
[0111] Return and execute the step of obtaining the target service identifier in the call detail record (CDR) sublist until the target service identifier is the last one in the CDR list.
[0112] In one embodiment, the query module 10 is further configured to:
[0113] Extract user information from the call detail record (CDR) data; the user information includes user identifier and service identifier.
[0114] Based on the user information, the billing information corresponding to the call detail record (CDR) data is retrieved from a preset billing database.
[0115] In one embodiment, the query module 10 is further configured to:
[0116] Based on the user information, the call detail records (CDRs) corresponding to the same user in the call detail record (CDR) data are merged to remove duplicates of the user information;
[0117] Based on the deduplicated user information, the billing information corresponding to the call detail record (CDR) data is queried from the preset billing database.
[0118] In one embodiment, the updating module 30 is further configured to:
[0119] The cached pricing information is submitted to the billing database, and the pricing information is divided according to the user identifier in the user information;
[0120] Based on the tariff information of the same user after segmentation, the billing database is updated according to the service identifier in the user information.
[0121] In one embodiment, the call detail record (CDR) processing device further includes a cache clearing module, used for:
[0122] The tariff information and the billing information are cleared to release the memory space occupied by the tariff information and the billing information in the cache resource pool.
[0123] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 can call a computer program in the memory 630 to execute the steps of a call detail record (CDR) processing method, such as:
[0124] The system acquires call detail records (CDRs) to be processed and queries the pre-designed fee database for the corresponding billing information; the billing information includes billing rules and resource information.
[0125] The billing information is cached in a preset cache resource pool, and the call detail records (CDRs) in the call detail record (CDR) data are billed one by one based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool.
[0126] After the call detail record (CDR) data has been processed for billing, the cached billing information is submitted to the billing database to update the billing database.
[0127] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0128] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the call detail record (CDR) processing methods provided in the above embodiments, such as:
[0129] The system acquires call detail records (CDRs) to be processed and queries the pre-designed fee database for the corresponding billing information; the billing information includes billing rules and resource information.
[0130] The billing information is cached in a preset cache resource pool, and the call detail records (CDRs) in the call detail record (CDR) data are billed one by one based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool.
[0131] After the call detail record (CDR) data has been processed for billing, the cached billing information is submitted to the billing database to update the billing database.
[0132] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing a processor to execute the steps of the call detail record (CDR) processing methods provided in the above embodiments, such as including:
[0133] The system acquires call detail records (CDRs) to be processed and queries the pre-designed fee database for the corresponding billing information; the billing information includes billing rules and resource information.
[0134] The billing information is cached in a preset cache resource pool, and the call detail records (CDRs) in the call detail record (CDR) data are billed one by one based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool.
[0135] After the call detail record (CDR) data has been processed for billing, the cached billing information is submitted to the billing database to update the billing database.
[0136] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A call detail record (CDR) processing method, characterized in that, include: Obtain the call detail records (CDRs) to be processed, and query the billing information corresponding to the CDRs from the pre-designed fee database; The billing information includes billing rules and resource information; The billing information is cached in a preset cache resource pool, and the call detail records (CDRs) in the call detail record (CDR) data are billed one by one based on the cached billing information to obtain the tariff information of each CDR in the CDR data and cache it in the cache resource pool. After the billing process for the call detail records (CDRs) in the CDR data is completed, the cached billing information is submitted to the billing database to update the billing database. The billing information based on caching is used to process the billing information for each call detail record (CDR) in the CDR data, obtaining the tariff information for each CDR and caching it in the cache resource pool, including: Based on the service identifier of each call detail record (CDR) in the CDR data, the CDR data is converted into a CDR list; Obtain the target call detail record (CDR) from the CDR list, and obtain the target billing information corresponding to the target CDR from the cached billing information; The target call detail record (CDR) is billed according to the target billing information to obtain the tariff information of the target CDR, and the tariff information of the target CDR is cached in the cache resource pool. If the target call detail record (CDR) is not the last CDR in the CDR list, then return and execute the step of obtaining the target CDR from the CDR list until the target CDR is the last CDR in the CDR list. When processing the first service identifier of the call detail record, the billing database is queried to obtain billing information, which is then cached in the process's cache resource pool. The calculation result of the corresponding service identifier is updated in the cache resource pool until the calculation result of the last service identifier is updated in the cache resource pool. Finally, the calculation results of all service identifiers are submitted to the billing resource pool.
2. The call detail record (CDR) processing method according to claim 1, characterized in that, When the target call detail record (CDR) includes multiple service identifiers, the target billing information includes billing sub-information corresponding to each service identifier; the step of performing billing processing on the target CDR based on the target billing information to obtain the tariff information of the target CDR, and caching the tariff information of the target CDR in the cache resource pool, includes: Based on each service identifier in the target call detail record (CDR), obtain the CDR list corresponding to the target CDR; Obtain the target service identifier from the call detail record (CDR) sublist, and obtain the billing sub-information corresponding to the target service identifier from the target billing information; the target service identifier can be any one of the CDRs in the CDR list. Billing processing is performed on the target service corresponding to the target service identifier in the target call detail record based on the billing sub-information to obtain the tariff information corresponding to the target service identifier, and the tariff information corresponding to the target service identifier is cached in the cache resource pool; Return and execute the step of obtaining the target service identifier in the call detail record (CDR) sublist until the target service identifier is the last one in the CDR list.
3. The call detail record (CDR) processing method according to claim 1, characterized in that, The step of retrieving the billing information corresponding to the call detail record (CDR) data from the pre-design fee database includes: Extract user information from the call detail record (CDR) data; the user information includes user identifier and service identifier. Based on the user information, the billing information corresponding to the call detail record (CDR) data is retrieved from a preset billing database.
4. The call detail record (CDR) processing method according to claim 3, characterized in that, The step of retrieving the billing information corresponding to the call detail record (CDR) data from a preset billing database based on the user information includes: Based on the user information, the call detail records (CDRs) corresponding to the same user in the call detail record (CDR) data are merged to remove duplicates of the user information; Based on the deduplicated user information, the billing information corresponding to the call detail record (CDR) data is queried from the preset billing database.
5. The call detail record (CDR) processing method according to claim 3, characterized in that, The step of submitting the cached tariff information to the billing database and updating the billing database includes: The cached pricing information is submitted to the billing database, and the pricing information is divided according to the user identifier in the user information; Based on the tariff information of the same user after segmentation, the billing database is updated according to the service identifier in the user information.
6. The call detail record (CDR) processing method according to claim 1, characterized in that, After submitting the cached tariff information to the billing database and updating the billing database, the method further includes: The tariff information and the billing information are cleared to release the memory space occupied by the tariff information and the billing information in the cache resource pool.
7. A call detail record (CDR) processing device, characterized in that, include: The query module is used to obtain call detail records (CDRs) to be processed and to query the billing information corresponding to the CDRs from the pre-designed fee database. The billing information includes billing rules and resource information; The caching module is used to cache the billing information into a preset cache resource pool, and to perform billing processing on each call detail record (CDR) in the call detail record (CDR) data based on the cached billing information, so as to obtain the tariff information of each CDR in the CDR data and cache it into the cache resource pool. The update module is used to submit the cached tariff information to the billing database after the billing process in the call detail record data is completed, and to update the billing database. The billing information based on caching is used to process the billing information for each call detail record (CDR) in the CDR data, obtaining the tariff information for each CDR and caching it in the cache resource pool, including: Based on the service identifier of each call detail record (CDR) in the CDR data, the CDR data is converted into a CDR list; Obtain the target call detail record (CDR) from the CDR list, and obtain the target billing information corresponding to the target CDR from the cached billing information; The target call detail record (CDR) is billed according to the target billing information to obtain the tariff information of the target CDR, and the tariff information of the target CDR is cached in the cache resource pool. If the target call detail record (CDR) is not the last CDR in the CDR list, then return and execute the step of obtaining the target CDR from the CDR list until the target CDR is the last CDR in the CDR list. When processing the first service identifier of the call detail record, the billing database is queried to obtain billing information, which is then cached in the process's cache resource pool. The calculation result of the corresponding service identifier is updated in the cache resource pool until the calculation result of the last service identifier is updated in the cache resource pool. Finally, the calculation results of all service identifiers are submitted to the billing resource pool.
8. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the call detail record (CDR) processing method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the call detail record (CDR) processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Charging method and system
CN110662188A
Short message service charging method and device and electronic equipment
CN116056018A