CDR real-time synthesis system and method based on distributed cache
Through distributed caching technology, CDR data is synthesized in real time in communication systems, and the problems of missing, duplicate and chaotic CDR data in existing systems are solved, real-time synthesis and resource optimization of on- and unconnected calls are realized.
Patent Information
- Application Number
- CN202510390187.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-11
AI Technical Summary
Existing communication systems cannot generate CDR data in real time, and there are problems of missing, duplicate and chaotic TDR data, and cannot support CDR synthesis for long calls, and have high resource utilization.
A CDR real-time synthesis system based on distributed cache is adopted, including a TDR signaling reception module, a CDR real-time synthesis module and a CDR output module. The distributed cache component temporarily stores intermediate state CDR data, and stores and synthesizes data through the calling number and called number as keys, and outputs CDR signaling after releasing resources.
Real-time CDR data synthesis with on- and unreached calls is realized, reducing data loss and duplication, improving system scalability, reducing resource usage, and meeting the real-time requirements of anti-fraud services.
Smart Images

Figure CN120301973A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a CDR real-time synthesis system and method based on distributed caching. Background Art
[0002] With the continuous development of communication technologies, more and more telecom value-added services have emerged in the communication field, and many of them are triggered by call signaling. In anti-fraud telecom value-added services, anti-fraud warning data modeling can use information such as call status and call duration as data factors for modeling to improve the accuracy of the output results of the anti-fraud warning data model. Moreover, anti-fraud telecom value-added services have relatively high requirements for the real-time nature of anti-fraud warning data. Existing communication systems, because they did not consider the function of real-time CDR generation during system construction, can only provide real-time TDR data and cannot output real-time CDR data externally. And the commonly used method of offline CDR generation cannot meet the requirements of anti-fraud services for data real-time nature. Currently, the main problems faced in the process of real-time CDR generation are as follows:
[0003] 1. Problems of partial loss, duplication, and disordered time sequence existing in TDR data.
[0004] 2. Modern communication systems cannot support the synthesis of CDRs for long calls. For example, patent application CN114189821A discloses a call detail record signaling synthesis system and method. By using the session window and allowedLateness of Flink, a trigger Trigger is set to trigger the aggregation function at a fixed frequency of 1 minute. If the CDR signaling still cannot be synthesized after 1 hour, the signaling is discarded. The algorithm implemented by this method is relatively complex, can only synthesize CDRs with a call duration less than 1 hour, and cannot synthesize CDR signaling for unconnected calls.
[0005] 3. It is impossible to release the occupied resources in a timely manner after receiving the TDR signaling of call termination. Summary of the Invention
[0006] The purpose of the present invention is to overcome the defects existing in the above-mentioned prior art, and provide a CDR real-time synthesis system and method based on distributed caching, which can synthesize CDR data for both connected and unconnected calls in real time, improve the scalability of the system, reduce the complexity of the system, and reduce resource occupancy.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A CDR real-time synthesis system based on distributed cache, comprising a TDR signaling receiving module, a CDR real-time synthesis module, and a CDR output module connected in sequence. The TDR signaling receiving module is used to receive signaling information from an external communication system and preprocess the signaling information to obtain a standardized TDR signaling. The CDR real-time synthesis module is used to receive the standardized TDR signaling and synthesize the CDR data into CDR signaling in real time according to CDR synthesis conditions. A distributed cache component is provided in the CDR real-time synthesis module, and the distributed cache component is used to temporarily store intermediate CDR data. The CDR output module is used to transmit the CDR signaling output by the CDR real-time synthesis module to a downstream value-added service system for further service processing.
[0009] Further, the specific steps for preprocessing the signaling information include: decoding the signaling information, removing redundant data and filtering irrelevant data, and organizing to obtain a standardized TDR signaling.
[0010] Further, the TDR signaling includes multiple types of data such as the calling number, called number, event type, and timestamp.
[0011] Further, the event types include call initiation event, ringing event, answer event, and hang-up event.
[0012] Further, during the real-time synthesis of the CDR signaling, the call status and call duration of the CDR data are calculated according to the TDR signaling. The call status of the CDR data includes connected and not connected, and the call duration is the time difference between the timestamp of the answer event and the timestamp of the hang-up event.
[0013] Further, the time window between the answer event and the hang-up event matches the call duration.
[0014] Further, the CDR synthesis condition is that the event type of the TDR signaling in the CDR data includes one of the call initiation event, ringing event, and answer event and includes the hang-up event.
[0015] Further, the CDR output module transmits the CDR signaling output by the CDR real-time synthesis module to a downstream value-added service system for further service processing in the form of a message queue or an API interface.
[0016] Further, the distributed cache component uses a Key-Value storage method to temporarily store intermediate CDR data.
[0017] According to another aspect of the present invention, there is provided a method for real-time synthesis of CDR based on distributed caching. By using the above-mentioned system for real-time synthesis of CDR based on distributed caching to perform real-time synthesis of CDR, the method includes the following steps:
[0018] Receive TDR signaling from an external communication system through a TDR signaling receiving module;
[0019] The CDR real-time synthesis module uses the calling number and called number of the TDR signaling as the distributed cache Key. After receiving each TDR signaling, check whether the CDR data corresponding to the Key exists in the distributed cache component:
[0020] If the CDR data corresponding to the Key does not exist, add and initialize the CDR data in the distributed cache component, and merge the latest TDR signaling into the CDR data.
[0021] If the CDR data corresponding to the Key exists, merge the latest TDR signaling into the CDR data, and reset the expiration time of the distributed cache Key according to the signaling type of the latest received TDR signaling.
[0022] Determine whether the CDR data in the distributed cache component meets the CDR synthesis condition:
[0023] If it meets the CDR synthesis condition, enter the CDR real-time synthesis step; if it does not meet the CDR synthesis condition, continue to wait for the next TDR signaling with the same distributed cache Key.
[0024] Calculate the call status and call duration of the CDR data according to the signaling type and signaling time of the TDR signaling, and synthesize the TDR signaling into a CDR signaling.
[0025] After the CDR signaling synthesis is completed, delete the CDR data of the distributed cache Key to release the cache resources;
[0026] After releasing the cache resources, the CDR output module outputs the CDR signaling to the value-added service system through an API interface or a message queue.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] 1. The present invention sets a distributed cache component in the CDR real-time synthesis module, temporarily stores the intermediate CDR data in the distributed cache component. The distributed cache component supports large-scale data storage and access requirements, has a fast access speed, and is based on a distributed architecture. It realizes dynamic expansion through the nodes of the distributed cache, improves the scalability of the system, and ensures the consistency of TDR data among multiple nodes of the distributed cache through a distributed consistency protocol, reducing problems such as partial loss, duplication, and disorder of timing existing in TDR data.
[0029] 2. After receiving each TDR signaling, the present invention uses the calling number and called number of the TDR signaling as the distributed cache key, searches in the distributed cache component whether there is CDR data corresponding to the key, and judges whether the CDR data in the distributed cache component meets the CDR synthesis conditions. It calculates the call status and call duration of the CDR data according to the signaling type and signaling time of the TDR signaling, can synthesize the CDR data of connected and unconnected calls into CDR signaling in real time, and deletes the CDR data of the distributed cache key after the CDR signaling synthesis is completed, releasing cache resources and reducing the resource occupation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a schematic structural diagram of a CDR real-time synthesis system based on a distributed cache proposed by the present invention;
[0031] Figure 2 is a schematic diagram of call windows for connected and unconnected calls;
[0032] Figure 3 is a schematic diagram of the Redis cluster slot routing algorithm;
[0033] Figure 4 is a schematic structural diagram of the CDR output module transmitting CDR signaling to the downstream value-added service system. Among them, (4a) is a schematic structural diagram of the CDR output module transmitting CDR signaling to the downstream value-added service system through a message queue, and (4b) is a schematic structural diagram of the CDR output module transmitting CDR signaling to the downstream value-added service system through an API interface;
[0034] Figure 5 is a schematic flow diagram of a CDR real-time synthesis method based on a distributed cache proposed by the present invention.
[0035] Legend: 1. Communication system; 2. CDR real-time synthesis system; 201. TDR signaling receiving module; 202. CDR real-time synthesis module; 203. CDR output module; 3. Value-added service system. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and gives the detailed implementation manner and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0037] English abbreviations involved:
[0038] Transaction Detail Record: TDR
[0039] Call Detail Record: CDR
[0040] Application Programming Interface: API
[0041] Embodiment 1
[0042] This embodiment provides a CDR real-time synthesis system based on distributed cache, as Figure 1 shown, including: a TDR signaling receiving module 201, a CDR real-time synthesis module 202, and a CDR output module 203 that are connected in sequence. The TDR signaling receiving module 201 is used to receive signaling information from the external communication system 1 and preprocess the signaling information to obtain a standardized TDR signaling. The CDR real-time synthesis module 202 is used to receive the standardized TDR signaling and synthesize CDR data into CDR signaling in real time according to the CDR synthesis condition. The CDR synthesis condition is that the event types of the TDR signaling in the CDR data include a hang-up event and one of a call-initiation event, a ringing event, and a response event. A distributed cache component is set in the CDR real-time synthesis module 202, and the distributed cache component uses a Key-Value storage method to temporarily store the intermediate CDR data. The CDR output module 203 is used to transmit the CDR signaling output by the CDR real-time synthesis module to the downstream value-added service system 3 for further service processing.
[0043] The TDR signaling receiving module 201 receives signaling information from the external communication system 1 through the API interface. The specific steps for preprocessing the signaling information include: decoding the signaling information, removing redundant data and filtering irrelevant data, and sorting to obtain a standardized TDR signaling. A set of TDR signaling is generated for one call. The TDR signaling includes multiple types of data such as the calling number, the called number, the event type, and the timestamp. The calling number is the number that actively makes a call, the called number is the called telephone number, the event type is a signaling event type in a set of TDR signaling, the event types include a call-initiation event, a ringing event, a response event, and a hang-up event, and the timestamp is the time when the signaling is generated.
[0044] Based on the characteristics of the telecommunication network, such as Figure 2 As shown, the time window between the originating call event and the ringing event is usually a few seconds; the time window between the ringing event or the answering event is usually no more than 60 seconds; the time window between the answering event and the hanging-up event matches the call duration. According to relevant statistics, 90% of the call durations do not exceed 5 minutes, and 99% of the call durations do not exceed 60 minutes. Here, a reasonable call duration window can be selected according to the accuracy requirements of the downstream value-added service system 3 for the call duration.
[0045] In this embodiment, the TDR signaling received by the TDR signaling receiving module 201 is shown in Table 1.
[0046] Table 1 TDR Signaling Information
[0047]
[0048] During the real-time synthesis of the CDR signaling, the call status and call duration of the CDR data are calculated according to the TDR signaling. The call status of the CDR data includes connected and not connected, and the call duration is the time difference between the time stamp of the answering event and the time stamp of the hanging-up event.
[0049] An example of a set of TDR signaling for a connected call is shown in Table 2.
[0050] Table 2 TDR Signaling for Connected Calls
[0051] Calling number Called number Event type Timestamp Number A Number B Call initiation 20240102123456 Number A Number B Ringing 20240102123458 Number A Number B Answer 20240102123515 Number A Number B Hang up 20240102123825
[0052] As can be seen from Table 2, the calling user initiates a call at 34 minutes and 56 seconds, the called party's terminal starts ringing at 34 minutes and 58 seconds, the called user picks up the phone and connects the call at 35 minutes and 15 seconds, and the calling and called users hang up at 38 minutes and 25 seconds, and the call is completed.
[0053] A set of TDR signaling for a non-connected call, compared with a connected call, only lacks the answering signaling, and an example is shown in Table 3.
[0054] Table 3 TDR Signaling for Non-connected Calls
[0055] Calling number Called number Event type Timestamp Number A Number B Call initiation 20240102123456 Number A Number B Ringing 20240102123458 Number A Number B Hang up 20240102123515
[0056] As can be seen from Table 3, the calling user initiates a call at 34 minutes and 56 seconds, the called party's terminal starts ringing at 34 minutes and 58 seconds, and the call is not connected at 35 minutes and 15 seconds due to the calling user hanging up, the called user rejecting, or the called user not answering in time.
[0057] After receiving the TDR signaling with the event type of hanging up, calculate the call status of this call and calculate the call duration of this call. After the calculation is completed, close the session window.
[0058] Call status calculation: Not connected: No response signaling received; Connected: Response signaling received.
[0059] Call duration calculation: The time difference between the hangup signaling timestamp and the response signaling timestamp.
[0060] An example of the finally synthesized CDR signaling is shown in Table 4.
[0061] Table 4 Main fields of CDR signaling
[0062]
[0063] In the present invention, by setting a distributed cache component in the CDR real-time synthesis module 202, the intermediate CDR data is temporarily stored on multiple distributed nodes, and multiple servers work together to share the pressure of data storage and access. The distributed cache component supports large-scale data storage and access requirements, has a fast access speed, and is based on a distributed architecture. Through the nodes of the distributed cache, dynamic expansion is achieved, improving the scalability of the system. Through the distributed consistency protocol, the consistency of TDR data among multiple nodes of the distributed cache is ensured, reducing problems such as partial loss, duplication, and timing chaos of TDR data.
[0064] The distributed cache component uses the Key-Value storage method to temporarily store the intermediate CDR data. By calculating the corresponding distributed storage node for a certain Key through the routing algorithm, the Value data can be stored or read at this storage node. Value generally supports multiple data storage types such as String and Hash.
[0065] The CDR real-time synthesis module 202 receives the standardized TDR signaling through the API interface. Since there is no unique identifier representing a call in the TDR signaling, the present invention uses the calling number and the called number as the Key of the distributed cache to group and store the call information, and uses the distributed cache component as a short-term storage medium to temporarily store the intermediate CDR data. The Value corresponding to each Key is a CDR signaling information. The distributed cache uses the common open-source product Redis. As Figure 3 shown, Redis calculates a 16-bit value for the Key value using the CRC16 algorithm, and performs a bitwise AND operation with 0x3FFF to obtain the slot value within the range of 0 to 16383 corresponding to the Key value. The Redis client accesses information at the corresponding Redis node according to the slot value of the Key and the node slot information stored in the cluster routing information table. The number of nodes in the Redis cluster can be expanded according to the needs of business development to increase the cluster cache capacity, and can be expanded up to 16384 nodes at most.
[0066] The general method for CRC16 calculation is as follows:
[0067] Step 1: Preset a 16-bit register value of 0xFFFF. This register is called the CRC register;
[0068] Step 2: Exclusive-OR the first 8-bit binary data (i.e., the first byte of the communication information frame) with the lower 8 bits of the 16-bit CRC register, and place the result in the CRC register. The higher 8 bits of the data remain unchanged;
[0069] Step 3: Shift the content of the CRC register one bit to the right (towards the higher bits), fill the highest bit with 0, and check the shifted-out bit;
[0070] Step 4: If the shifted-out bit is 0: Repeat Step 3 (shift one more bit to the right); if the shifted-out bit is 1, exclusive-OR the CRC register with a polynomial (A001);
[0071] Step 5: Repeat Steps 3 and 4 until shifted 8 times, so that the entire 8-bit data is processed;
[0072] Step 6: Repeat Steps 2 to 5 to process the next byte of the communication information frame;
[0073] Step 7: After all bytes of the communication information frame are calculated according to the above steps, swap the higher and lower bytes of the obtained 16-bit CRC register;
[0074] Step 8: The content of the finally obtained CRC register is the CRC code.
[0075] When the system determines that all TDR signaling of a call has been collected completely, retrieve the CDR data from the distributed cache and output it, and delete the CDR data of the distributed cache key from the distributed cache to release the occupied memory resources. After real-time synthesizing the CDR data information and releasing the resources, output the CDR data to the downstream value-added service system through methods such as message queue or API interface for further business processing, such as Figure 4 shown. The structure of the CDR output module 203 transmitting CDR signaling to the downstream value-added service system 4 through the message queue is as shown in Figure 4 (4a) of, and the structure of the CDR output module 203 transmitting CDR signaling to the downstream value-added service system 4 through the API interface is as shown in Figure 4 (4b) of.
[0076] Embodiment 2
[0077] This embodiment provides a method for real-time synthesis of CDR based on a distributed cache. By using the system for real-time synthesis of CDR based on a distributed cache described in Embodiment 1 for real-time synthesis of CDR, as Figure 5As shown, it includes the following steps:
[0078] S1. Receive the TDR signaling from the external communication system 1 through the TDR signaling receiving module 201.
[0079] S2. The CDR real-time synthesis module 202 uses the calling number and called number of the TDR signaling as the distributed cache Key. After receiving each TDR signaling, it checks whether the CDR data corresponding to the Key exists in the distributed cache component.
[0080] If the CDR data corresponding to the Key does not exist, new and initialize the CDR data in the distributed cache component, and merge the latest TDR signaling into the CDR data.
[0081] If the CDR data corresponding to the Key exists, merge the latest TDR signaling into the CDR data, and reset the expiration time of the distributed cache Key according to the signaling type of the latest received TDR signaling.
[0082] S3. Determine whether the CDR data in the distributed cache component meets the CDR synthesis condition.
[0083] If it meets the CDR synthesis condition, enter the CDR real-time synthesis step; if it does not meet the CDR synthesis condition, continue to wait for the next TDR signaling with the same distributed cache Key. The CDR synthesis condition is that the event type of the TDR signaling in the CDR data includes one of the call initiation event, ringing event, and answer event and includes the hang-up event.
[0084] S4. Calculate the call status and call duration of the CDR data according to the signaling type and signaling time of the TDR signaling, and synthesize the TDR signaling into the CDR signaling.
[0085] S5. After the CDR signaling synthesis is completed, delete the CDR data of the distributed cache Key and release the cache resources.
[0086] S6. After releasing the cache resources, the CDR output module 203 outputs the CDR signaling to the value-added service system 3 through the API interface or message queue method.
[0087] The rest is the same as in Embodiment 1.
[0088] The above has described in detail the preferred specific embodiments of the present invention. It should be understood that those of ordinary skill in the art can make many modifications and variations according to the concept of the present invention without creative work. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field of the present invention based on the concept of the present invention through logical analysis, reasoning, or limited experiments on the basis of the prior art should be within the protection scope determined by the claims.
Claims
1. A CDR real-time synthesis system based on distributed caching, characterized in that It includes a TDR signaling receiving module (201), a CDR real-time synthesis module (202), and a CDR output module (203) connected in sequence. The TDR signaling receiving module (201) is used to receive signaling information from an external communication system (1), preprocess the signaling information to obtain a standardized TDR signaling. The CDR real-time synthesis module (202) is used to receive the standardized TDR signaling, and synthesize the CDR data into a CDR signaling in real time according to CDR synthesis conditions. A distributed cache component is set in the CDR real-time synthesis module (202), and the distributed cache component is used to temporarily store the CDR data in an intermediate state. The CDR output module (203) is used to transmit the CDR signaling output by the CDR real-time synthesis module to a downstream value-added service system (3) for further service processing.
2. The CDR real-time synthesis system based on distributed cache according to claim 1, characterized in that The specific steps for preprocessing the signaling information include: decoding the signaling information, removing redundant data and filtering irrelevant data, and obtaining a standardized TDR signaling after sorting.
3. The CDR real-time synthesis system based on distributed cache according to claim 1, characterized in that The TDR signaling includes multiple types of data such as the calling number, called number, event type, and timestamp.
4. The CDR real-time synthesis system based on distributed cache according to claim 3, wherein The event type includes call initiation event, ringing event, answering event, and hanging-up event.
5. The CDR real-time synthesis system based on distributed cache according to claim 4, wherein During the real-time synthesis of the CDR signaling, calculate the call status and call duration of the CDR data according to the TDR signaling. The call status of the CDR data includes connected and not connected, and the call duration is the time difference between the timestamp of the answering event and the timestamp of the hanging-up event.
6. The CDR real-time synthesis system based on distributed cache according to claim 5, wherein, The time window between the answering event and the hanging-up event matches the call duration.
7. The CDR real-time synthesis system based on distributed cache according to claim 6, wherein The CDR synthesis condition is that the event type of the TDR signaling in the CDR data includes one of the call initiation event, ringing event, and answering event and includes the hanging-up event.
8. The CDR real-time synthesis system based on distributed cache according to claim 1, characterized in that The CDR output module transmits the CDR signaling output by the CDR real-time synthesis module to the downstream value-added service system for further service processing in the form of a message queue or an API interface.
9. The CDR real-time synthesis system based on distributed cache according to claim 1, wherein The distributed cache component uses a Key-Value storage method to temporarily store the CDR data in an intermediate state.
10. A real-time synthesis method of CDR based on distributed cache, characterized in that Performing CDR real-time synthesis by using the CDR real-time synthesis system based on distributed cache as described in any one of claims 1-9 includes the following steps: Receiving TDR signaling from an external communication system (1) through the TDR signaling receiving module (201); The CDR real-time synthesis module (202) uses the calling number and called number of the TDR signaling as the distributed cache Key. After receiving each TDR signaling, check whether the CDR data corresponding to the Key exists in the distributed cache component: If the CDR data corresponding to the Key does not exist, add and initialize the CDR data in the distributed cache component, and merge the latest TDR signaling into the CDR data. If the CDR data corresponding to the Key exists, merge the latest TDR signaling into the CDR data, and reset the expiration time of the distributed cache Key according to the signaling type of the latest received TDR signaling. Determine whether the CDR data in the distributed cache component meets the CDR synthesis condition: If the CDR synthesis condition is met, enter the CDR real-time synthesis step. If the CDR synthesis condition is not met, continue to wait for the next TDR signaling of the same distributed cache key; Calculate the call status and call duration of the CDR data according to the signaling type and signaling time of the TDR signaling, and synthesize the TDR signaling into CDR signaling; After the CDR signaling synthesis is completed, delete the CDR data of the distributed cache key to release the cache resources; After releasing the cache resources, the CDR output module (203) outputs the CDR signaling to the value-added service system (3) through the API interface or the message queue method.
Citation Information
Patent Citations
Call detail record signaling synthesis system and method
CN114189821A