Call bill storage method, query method, apparatus and device, and storage medium

By using scroll window grouping and Bloom filters to build indexes in a streaming framework, the problem of large number of call order storage space and low query efficiency is solved, and efficient storage and query are achieved.

CN119088763APending Publication Date: 2024-12-06CHINA MOBILE GRP GANSU CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411076258.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, when storing call sheets, there are many files with the same number, resulting in large storage space, high cost, and low query efficiency, so that the number can not be effectively used as the first dimension for retrieval.

Method used

The scroll window in the streaming framework is used to group the call sheet data according to the number segment attributes, and an index file is constructed through the Bloom filter, which is associated with the storage call sheet file and the index file to reduce storage space and query time.

Benefits of technology

It effectively reduces the space occupied by call order storage and the storage space of index files, reduces storage costs, and improves the query efficiency of call orders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088763A_ABST
    Figure CN119088763A_ABST
Patent Text Reader

Abstract

The invention discloses a ticket storage method, a ticket query method, a ticket query device, equipment and a storage medium, and relates to the technical field of data processing, and the method comprises the following steps: obtaining ticket data, determining a number segment attribute corresponding to the ticket data based on a ticket number in the ticket data, sending the ticket data to a distributed message queue, generating ticket stream data, and sending the ticket stream data to the distributed message queue; on the basis of a rolling window with number segment attributes as key values in a streaming framework, conversation single-stream data are grouped through the rolling window according to the number segment attributes, a ticket file corresponding to each number segment attribute is obtained, then the number segment attributes corresponding to the ticket files are mapped to a Bloom filter, an index file is constructed, and the number segment attributes corresponding to the ticket files are mapped to the Bloom filter. And finally, associatively storing the ticket file and the index file. According to the embodiment of the invention, the possibility that various forms of telephone bills corresponding to the same number are dispersed to a plurality of different files can be reduced, the space occupied by telephone bill storage is reduced, the storage space of index files can be reduced, and the storage cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to a storage method, query method, device, equipment, storage medium and computer program product for a call record. Background Art

[0002] When users use the operator's network or system, a call bill is generated. The billing system collects the call bills generated by the network element or system and performs a series of billing batch processing. In this process, multiple forms of call bills are generated, and each form of call bill is a snapshot of each processing stage, including original call bills, decoded pre-processed call bills, batch-priced call bills, warehoused call bills, and error bills.

[0003] These call records need to be stored and backed up according to business and management needs for restoration in specific scenarios. The existing technology stores part of the call records in the order of their generation time. There are many files corresponding to the call records of the same number, and the storage space occupied by the call records is very large, resulting in very high storage costs. Summary of the invention

[0004] The embodiments of the present application provide a storage method, query method, device, equipment, storage medium and computer program product for a call record, which can reduce the space occupied by storing call records and reduce the storage cost of call records.

[0005] In a first aspect, an embodiment of the present application provides a method for storing a call record, the method comprising:

[0006] Get call bill data, which includes numbers;

[0007] Based on the number, the number segment attribute corresponding to the call record data is determined through the preset correspondence between the number and the number segment attribute;

[0008] Send the call record data to the distributed message queue to generate call record flow data;

[0009] Based on the rolling window with the number segment attribute as the key value in the streaming framework, the call record flow data is grouped according to the number segment attribute through the rolling window to obtain the call record file corresponding to each number segment attribute;

[0010] By mapping the number segment attribute corresponding to the call record file to the Bloom filter, an index file of the call record file is constructed; the index file includes the number segment attribute and the file identifier of the call record file;

[0011] The call record file and index file are stored in association.

[0012] In a second aspect, an embodiment of the present application provides a method for querying a call record, the method comprising:

[0013] Obtain the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range;

[0014] Based on the number, the number segment attribute corresponding to the call record to be queried is determined through the preset correspondence between the number and the number segment attribute;

[0015] The index file is determined according to the segment attribute and the query time range; the index file is constructed by mapping the segment attribute corresponding to the call record file to the Bloom filter;

[0016] Perform bloom filtering on the index file based on the number to obtain the call record file corresponding to the number;

[0017] The call record data in the call record file is traversed, and the call record to be queried is determined based on the file identifier.

[0018] In a third aspect, an embodiment of the present application provides a storage device for a call record, the device comprising:

[0019] The acquisition module is used to obtain the call bill data, which includes the number;

[0020] A determination module, used to determine the number segment attribute corresponding to the call record data based on the number and through the preset correspondence between the number and the number segment attribute;

[0021] The acquisition module is also used to send the call bill data to the distributed message queue to generate the call bill flow data;

[0022] A storage module is used for grouping call bill flow data according to the number segment attribute based on a rolling window with the number segment attribute as a key value in the streaming framework through the rolling window to obtain a call bill file corresponding to each number segment attribute;

[0023] A construction module is used to construct an index file of the call record file by mapping the number segment attribute corresponding to the call record file to the Bloom filter; the index file includes the number segment attribute and the file identifier of the call record file;

[0024] The storage module is also used to associate and store the call record file and the index file.

[0025] In a fourth aspect, an embodiment of the present application provides a device for querying a call record, the device comprising:

[0026] The acquisition module is used to obtain the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range;

[0027] A determination module, used to determine the number segment attribute corresponding to the call record to be queried based on the number and through the preset correspondence between the number and the number segment attribute;

[0028] The determination module is also used to determine the index file according to the segment attribute and the query time range; the index file is constructed by mapping the segment attribute corresponding to the call record file to the Bloom filter;

[0029] A query module is used to perform Bloom filtering on the index file based on the number to obtain the call record file corresponding to the number;

[0030] The query module is also used to traverse the call record data in the call record file and determine the call record to be queried based on the file identifier.

[0031] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the call record storage method of the first aspect or the call record query method of the second aspect.

[0032] In a sixth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method for storing a call record as in the first aspect or the method for querying a call record as in the second aspect are implemented.

[0033] In the seventh aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device executes the call record storage method as in the first aspect or executes the call record query method as in the second aspect.

[0034] The method for storing the call bill in the embodiment of the present application can be based on a rolling window with the number segment attribute as the key value in the streaming framework, and the call bill flow data can be grouped according to the number segment attribute corresponding to the number in the call bill through the rolling window to obtain the call bill file corresponding to each number segment attribute. Since the call bill file corresponds to the number segment attribute, it is convenient to compress the call bill data with the same number segment attribute, and it can reduce the possibility of multiple forms of call bill data corresponding to the same number being dispersed into multiple different files, thereby reducing the space occupied by the call bill storage and reducing the storage cost. At the same time, by constructing an index file through a Bloom filter, the storage space of the index file can be reduced, and the storage cost can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] Figure 1 It is a flowchart of a method for storing a call record provided by an embodiment of the present application;

[0037] Figure 2 This is a flowchart of an implementation method of S104 provided in an embodiment of the present application;

[0038] Figure 3 It is a flowchart of a method for querying a call record provided by an embodiment of the present application;

[0039] Figure 4 It is a structural schematic diagram of a storage device for a call record provided by an embodiment of the present application;

[0040] Figure 5 It is a structural diagram of a device for querying a call bill provided by an embodiment of the present application;

[0041] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0044] When users use the operator's network or system, they will generate a call bill, which records the communication number, time, location, type, content and other information in detail. The billing system collects the original call bill generated by the network element or system, and performs a series of billing batch processing based on the original call bill. In this process, various forms of call bills will be generated, including original call bills, decoded pre-processed call bills, batch-priced call bills, warehoused call bills, error call bills, etc. Each different type of call bill is a snapshot of each processing stage.

[0045] These call records need to be stored and backed up according to business and management needs: first, to facilitate system recovery, such as re-pricing; second, to facilitate user query and use, so that users can view the call records of the current month and previous months; third, for centralized management needs, according to the requirements of relevant competent authorities, call records need to be stored for a certain period of time.

[0046] Due to the huge volume of call records, in actual scenarios, call records are often divided into near-line call records and far-line call records. Near-line call records are generally stored in high-end storage devices, such as database storage, so that they can be quickly restored and queried; far-line call records are generally stored in low-end storage devices, often in file storage, and the media used for file storage mainly include tapes, optical disks, hard disks, etc. Near-line call records are generally stored in a rotational manner, and the storage volume is relatively controllable. However, far-line call records accumulate over time, the amount of call record data continues to increase, the required storage devices continue to increase, and the storage costs paid by enterprises continue to increase.

[0047] In the prior art, when storing call records in files, the files are often written in the order of the time when the call records were generated. This results in a large number of storage files corresponding to the call records of the same number, a low file compression rate, a large amount of space occupied by storing the call records, and a very high storage cost.

[0048] In addition, the main purpose of call record storage backup is to facilitate recovery and meet the query needs of users or management agencies. Since the existing call record storage method is to write the call record into the file in the order of its generation time, even if an index can be generated in the process of writing the call record into the file, it is a file-level index, not a user-level index, and it is impossible to use the number as the first query dimension for retrieval. When searching for call records, it is necessary to scan and retrieve all files based on the time range, which results in a large number of files to be searched, a long query cycle, and low query efficiency.

[0049] In order to solve the problems of the prior art, the embodiments of the present application provide a storage method, query method, device, equipment, storage medium and computer program product for call bills, which can be based on a rolling window with segment attributes as key values ​​in a streaming framework, and the call bill flow data can be grouped according to the segment attributes corresponding to the numbers in the call bill through the rolling window to obtain a call bill file corresponding to each segment attribute. Since the call bill file corresponds to the segment attributes, it is convenient to compress the call bill data with the same segment attributes, and can reduce the possibility of multiple forms of call bill data corresponding to the same number being dispersed into multiple different files, thereby reducing the space occupied by the call bill storage and reducing the storage cost. At the same time, by constructing an index file through a Bloom filter, the storage space of the index file can be reduced, and the storage cost can be reduced.

[0050] The following first introduces the method for storing call records provided in the embodiment of the present application.

[0051] Figure 1 The flowchart of the method for storing a call record provided by an embodiment of the present application is shown in FIG. Figure 1 As shown, the method may include the following steps: S101 to S105.

[0052] S101: Obtain call record data.

[0053] In this step, the call record is used to record the information generated when the user uses the operator's network or system, as well as the information generated by the billing system for billing and pricing of the call record. There are many types of call records, such as original call records, decoded pre-processed call records, pricing call records, warehoused call records, and error call records. The call record format can be binary, JSON, CSV, etc.

[0054] In some embodiments, the call record data may include the number, the type of call record, and the geographical location where the call record was generated.

[0055] In some embodiments, the call record data may be obtained from an operator communication system or a billing system.

[0056] In some embodiments, obtaining the call record data may be obtained from a file system storing the call record data.

[0057] S102: Based on the number, determine the number segment attribute corresponding to the call record data through the preset correspondence between the number and the number segment attribute.

[0058] Since the number and size of numbers in call records of different types and different geographical locations are inconsistent, numbers of different types and regions have different number segment attributes.

[0059] In some embodiments, the number segment attributes may include hundreds segment and thousands segment.

[0060] In order to be able to more efficiently store call records using numbers as the first dimension, firstly, based on the call record number, the number segment attribute corresponding to the call record data is determined through the preset correspondence between the number and the number segment attribute, so that numbers with the same number segment attribute can be stored centrally.

[0061] In some embodiments, the correspondence between the preset number and number segment attributes may include: the number whose last digit is between [000-999] is in the thousands segment, and the number whose last digit is between [0000-9999] is in the tens of thousands segment.

[0062] S103: Send the call record data to the distributed message queue to generate call record flow data.

[0063] In this step, the distributed message queue is used to ensure the delivery of the call record data. After obtaining the call record data, the sender of the call record data does not need to wait for the response of the receiver. The call record data is stored in the message queue until it is retrieved by the receiver.

[0064] In some embodiments, the distributed message queue may be a Kafka message queue.

[0065] When faced with the processing of a huge amount of call bill data, the distributed message queue is used to generate call bill flow data, which reduces the coupling between the sender and receiver of the call bill data, ensures the efficient transmission of the call bill data, and improves the overall processing efficiency.

[0066] In some embodiments, sending the call record data to the distributed message queue may be accomplished through a data extraction tool.

[0067] S104: Based on a rolling window with the number segment attribute as a key value in the streaming framework, the call bill flow data is grouped according to the number segment attribute through the rolling window to obtain a call bill file corresponding to each number segment attribute.

[0068] In this step, the streaming framework can be used for streaming data. A rolling window is a way of evenly slicing data in a streaming framework. There is no overlap or gap between windows in a rolling window, and they are connected end to end. A rolling window can be defined based on time or the number of data.

[0069] In some embodiments, the streaming framework can be a Flink computing framework. Flink is a framework and distributed processing engine that can be used to perform stateful computing on unbounded data streams.

[0070] The call data generated by user communication is a typical unbounded stream data. The communication network element or system will continuously generate various call records according to the user's communication mode, and the billing system will also generate various call record snapshots in each processing link. Since the call record data is continuously generated, it is impossible to wait for all the call records to be processed before outputting them. The streaming framework can be used to perform window calculations on the call record stream data, turning the call record data from an unbounded stream into a bounded stream, and using a rolling window to ensure that the call record data is not processed repeatedly during the calculation process.

[0071] In the process of using a streaming framework to perform window calculations on call bill flow data, considering that the existing technology for storing call bills is to write them into files in the order of the time when the call bills were generated, there are many storage files corresponding to the same number, resulting in the problem of excessively high storage costs. The key value (key) of the rolling window is configured as the segment attribute corresponding to the call bill number. The rolling window with the segment attribute as the key value can group the call bill flow data according to the segment attribute to obtain the call bill file corresponding to each segment attribute.

[0072] By adopting the streaming framework, while realizing streaming processing of call record data, the key value of the rolling window in the streaming framework can be configured as the segment attribute to group the call record data according to the segment attribute, so as to obtain the call record file corresponding to each segment attribute. In this way, the stored call record data can be centrally stored with the number as the first dimension, reducing the number of stored files. At the same time, based on the call record files centrally stored with the number as the first dimension, it is possible to avoid scanning and retrieving the full amount of files based on the time range, which is convenient for realizing fast query of call records.

[0073] S105: Construct an index file of the call record file by mapping the number segment attribute corresponding to the call record file to the Bloom filter.

[0074] In this step, Bloom Filter is a probabilistic data structure with extremely high space efficiency, which can be used to determine whether an element may belong to a certain set. Bloom Filter has the characteristics of fast running speed and small memory usage, and has high time efficiency and space efficiency.

[0075] The index file can be used to search for the corresponding call record file based on the number segment attributes.

[0076] In some embodiments, the index file may include the number segment attribute and the file identifier of the call record file, wherein the file identifier may include the file name.

[0077] In the process of windowing calculation on call flow data using a streaming framework, an index file of the call file is constructed by mapping the segment attributes corresponding to the call file to a Bloom filter. This can reduce the storage space occupied by the index file, reduce storage costs, and improve the query efficiency of the call file.

[0078] S106: The call record file and the index file are stored in association with each other.

[0079] After the call record file is generated according to the number segment attributes and the index file corresponding to the call record file is constructed, the call record file and the index file are stored in association to complete the call record archiving. The associated storage of the call record file and the index file can facilitate the subsequent query and recovery of the call record file.

[0080] This embodiment can group the call bill flow data according to the number segment attributes corresponding to the number in the call bill based on the rolling window with the number segment attributes as the key value in the streaming framework, and obtain the call bill file corresponding to each number segment attribute. Since the call bill file corresponds to the number segment attributes, it is convenient to compress the call bill data with the same number segment attributes, and can reduce the possibility of multiple forms of call bill data corresponding to the same number being dispersed into multiple different files, thereby reducing the space occupied by the call bill storage and reducing the storage cost. At the same time, by constructing an index file through a Bloom filter, the storage space of the index file can be reduced, and the storage cost can be reduced.

[0081] In some embodiments, Figure 2 As shown, step S104: based on the rolling window with the number segment attribute as the key value in the streaming framework, the call bill flow data is grouped according to the number segment attribute through the rolling window to obtain the call bill file corresponding to each number segment attribute, which may include the following steps:

[0082] S1041: Determine the size of each rolling window based on a preset time period;

[0083] S1042: inputting the call bill flow data into at least one rolling window, segmenting the call bill flow data according to the number segment attribute based on the size of the rolling window, and obtaining the call bill data corresponding to each number segment attribute within a preset time period;

[0084] S1043: Generate a call record file corresponding to the call record data corresponding to each number segment attribute within a preset time period.

[0085] In this step, before using the streaming framework to perform window calculations on the single-stream data, a preset time period needs to be set for the streaming framework to define the size of the rolling window, i.e., the watermark of the streaming framework. Watermark is a mechanism used to advance time monotonically in the event time semantics of streaming processing. Events whose event time is less than the watermark time will not appear again. Timestamps can be periodically inserted into the data stream. Timestamps are special data elements that increase monotonically, which achieve irreversible advancement of time in the entire data stream.

[0086] In one embodiment, one end of the preset time period may be the time when the call record is generated. For example, the time when the voice call record is generated is the time when the phone is connected before the call starts.

[0087] In one embodiment, the other end of the above-mentioned preset time period may be a custom-set out-of-order time allowed, and the out-of-order time allowed is used to balance the call record data processing and the subsequent window waiting time.

[0088] In one embodiment, the above-mentioned allowed out-of-order time can be determined based on attributes such as the type of call record and the geographical location where the call record is generated. After determination, it can be verified through multiple rounds of testing to avoid the problem that the time setting is too small, resulting in too many files being output by the window, and the time setting is too large, resulting in too long waiting time for the streaming framework window calculation, and increased computing resource requirements.

[0089] By defining the size of the rolling window in the streaming framework through a preset time period, and configuring the key value of the rolling window as a number segment attribute, the call record data within the preset time period can be grouped according to the number segment attribute to obtain the call record file corresponding to each number segment attribute. This allows the stored call record data to be centrally stored with the number as the first dimension, thereby reducing the number of stored files. At the same time, based on the call record files centrally stored with the number as the first dimension, it is possible to avoid scanning and retrieving the entire file based on the time range, thereby facilitating rapid query of call records.

[0090] In some embodiments, step S1043: generating a call bill file corresponding to the call bill data corresponding to each number segment attribute within a preset time period may include:

[0091] Sort the call record data corresponding to each number segment attribute within the preset time period according to the preset order;

[0092] According to the sorted call record data, a call record file is obtained.

[0093] In order to improve the storage and query efficiency of the bill file, in the process of generating the bill file corresponding to the bill data corresponding to each number segment attribute within the preset time period, all the bill data obtained in a certain window can be sorted according to the preset order. The sorted bill file can also improve the file compression rate to a certain extent when it is subsequently compressed.

[0094] In one embodiment, the sorting is performed in a preset order, which may be sorting in numerical order, for example, sorting in ascending or descending order according to the number of digits.

[0095] In one embodiment, the sorting is performed in a preset order, which may be a chronological order, for example, in ascending or descending order according to the time when the call records are generated.

[0096] In one embodiment, after the call record files are sorted, a serial number corresponding to the call record file may be generated, and the serial number is globally unique.

[0097] In some embodiments, since call record data is collected from multiple call record sources, such as an operator system, a billing system, and a file system that stores historical call record data, late call record data may be generated. The late call record data can be processed according to the implementation method of any of the above embodiments, which will not be repeated here.

[0098] In some embodiments, step S105: constructing an index file of the call record file by mapping the number segment attribute corresponding to the call record file to a Bloom filter may include:

[0099] Get the number segment attributes corresponding to the call record file;

[0100] Based on the segment attributes, all numbers corresponding to the segment attributes are determined through the preset correspondence between numbers and segment attributes;

[0101] Through the preset hash function in the Bloom filter, all numbers are mapped to the array of the Bloom filter;

[0102] Serialize the array to get the index file.

[0103] In order to reduce storage costs while improving the query efficiency of stored call record files, taking into account the characteristics of Bloom filters that run fast and occupy little memory, using Bloom filters to build index files for call record files can reduce the storage space occupied by index files and reduce storage costs. At the same time, querying call record files based on the constructed index files can improve the efficiency of call record file queries.

[0104] In one embodiment, in the process of constructing the index file of the call record file through the Bloom filter, the Bloom filter can construct a bit array by allocating a piece of memory space, and the initial values ​​of the bits of the array are all set to 0. When adding a number element to the array of the Bloom filter, k independent hash functions can be used for calculation to obtain the hash value of the number element. The K positions of the array mapped by the hash value of the number element are all set to 1 to obtain the array mapped by the hash function. Among them, the k value can be customized according to actual needs.

[0105] In one embodiment, the array mapped by the above hash function may be serialized and output to obtain an index file.

[0106] In one embodiment, in order to reduce the misjudgment rate of Bloom filtering, the length of the Bloom filter array may be appropriately increased to improve the hit rate of the query.

[0107] In one embodiment, since the same number segment attribute corresponds to fewer numbers, for example, the thousand number segment does not exceed 10,000 numbers, the call bill file corresponding to each number segment attribute corresponds to only one index file, which will result in too many index files and too few index values ​​in one index file, which is not conducive to the management of index files and the query of call bill files. The index file can be formed according to a preset time unit, so that the call bill files corresponding to the same number segment attribute generate an index file in the same time unit.

[0108] In one embodiment, the index file is formed according to the preset time unit, which may be to take one day as a time unit, and generate an index file for the call record files corresponding to the same number segment attribute within the same day.

[0109] In some embodiments, before step S103: sending the call record data to the distributed message queue, the call record storage method may further include:

[0110] The degree of parallelism is determined based on the type of call records and the geographical location where the call records are generated.

[0111] In some embodiments, step S103: sending the call record data to the distributed message queue may include:

[0112] The call record data is sent to the distributed message queue in parallel according to the degree of parallelism.

[0113] Since there are multiple bill sources for bill data, in order to improve the processing efficiency of the bill data, the bill data can be sent from the bill sources to the distributed message queue in parallel.

[0114] At the same time, since the volume of call records of different types and different geographical locations varies greatly, the degree of parallel sending can be set according to the type of call records and the geographical location where the call records are generated in actual situations to improve the processing efficiency of call record data.

[0115] In some embodiments, step S106: storing the call record file and the index file in association with each other may include:

[0116] According to a preset compression algorithm, the call record file is compressed to obtain a compressed call record file;

[0117] The compressed call record file and index file are stored in association.

[0118] Since the call record file is restored less frequently and occupies more storage space, the regrouped call record files can be compressed to reduce the storage space occupied. In addition, the compressed files can be stored on low-end storage devices to further reduce storage costs.

[0119] Finally, the call record archiving is achieved by associating and storing the compressed call record file and the index file.

[0120] In one embodiment, since the index file is constructed using a Bloom filter and occupies a relatively small storage space, the index file may not be compressed.

[0121] In one embodiment, the above-mentioned preset compression algorithm may include Huffman coding compression, arithmetic compression method, etc. The specific selection of the compression algorithm can be set according to actual needs and will not be repeated here.

[0122] In one embodiment, after the compressed call record file and index file are stored in association with each other, the storage file storing the call record file and index file in association with each other may be named.

[0123] In one embodiment, the naming format of the above storage file can be: segment attribute, type of call record, geographical location where the call record is generated, start time of the call record, and end time sequence number of the call record.

[0124] Figure 3 The flowchart of the method for querying a call record provided by an embodiment of the present application is shown in FIG. Figure 3 As shown, the method may include the following steps: S201 to S205.

[0125] S201: Obtain the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range.

[0126] In some embodiments, when querying a call record, it is necessary to first clarify the relevant conditions of the call record to be queried, such as the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range, and the call record query can be performed based on the above conditions. Among them, the file identifier of the call record to be queried can include the file name.

[0127] S202: Based on the number, determine the number segment attribute corresponding to the call record to be queried through the preset correspondence between the number and the number segment attribute.

[0128] In this step, the preset correspondence between the number and the number segment attributes may be the correspondence between the number and the number segment attributes adopted by the method for storing the call record in any of the above embodiments, which will not be described in detail here.

[0129] S203: Determine the index file according to the segment attribute and the query time range.

[0130] In some embodiments, the index file is constructed by mapping the number segment attributes corresponding to the call record file to the Bloom filter.

[0131] When querying the call record file, first perform a "rough search" to determine the index file based on the number segment attributes and query time range, and then query the target call record in the index file. By preliminarily determining the index file corresponding to the call record file and searching for the target call record based on the index file, the problem of wasted computing power caused by directly searching a large number of call record files can be avoided.

[0132] S204: Perform Bloom filtering on the index file based on the number to obtain a call record file corresponding to the number.

[0133] In some embodiments, Bloom filtering is performed on the index file based on the number. Since the index file is constructed by mapping the number segment attributes corresponding to the call record file to the Bloom filter, it can be determined whether there is a corresponding call record file by detecting whether the number of the call record to be queried exists in the array of the Bloom filter.

[0134] In some embodiments, the above detection of whether the number of the call bill to be queried exists in the array of the Bloom filter can calculate the specific position of the number in the array through the hash function used to map the number in the Bloom filter. If the values ​​of these positions are all 1, it indicates that the number of the call bill to be queried exists, and the corresponding call bill file exists. If the values ​​of these positions are not all 1, the number of the call bill to be queried does not exist, and the corresponding call bill file does not exist.

[0135] In some embodiments, before performing Bloom filtering on the index file based on the number, the index file may be deserialized into memory first.

[0136] S205: Traverse the call record data in the call record file, and determine the call record to be queried based on the file identifier.

[0137] This step uses the file identifier to traverse the call record data in the call record file to determine the call record to be queried, thereby achieving "detailed search". Querying the call record within a small range defined by the index file can speed up the query and improve the query efficiency.

[0138] In some embodiments, before traversing the call record data in the call record file, if the call record file is a compressed file, the call record file may be decompressed first.

[0139] This embodiment implements the query of call records based on the storage method of the call records in the above embodiment. The corresponding segment attribute is determined by the number of the call record to be queried, and the index file is first searched according to the segment attribute and the query time range. The call record file is searched according to the index file to see whether it contains the call record file corresponding to the number to be searched, so as to achieve a "rough search" of the call record file. Then, all the call records in the corresponding call record file are traversed to achieve a "detailed search" of the call record file. Through the "rough search + detailed search" query method, the scope of searching the call record is gradually narrowed, which can improve the query efficiency of the call record.

[0140] Figure 4 Schematic diagram of a storage device 300 for a call record provided in an embodiment of the present application. Figure 4 As shown, the apparatus may include a data acquisition module 310 , a determination module 320 , a construction module 330 , and a storage module 340 .

[0141] The acquisition module 310 is used to acquire call bill data, where the call bill data includes a number;

[0142] The determination module 320 is used to determine the number segment attribute corresponding to the call record data based on the number and through the preset correspondence relationship between the number and the number segment attribute;

[0143] The acquisition module 310 is also used to send the call bill data to the distributed message queue to generate call bill flow data;

[0144] The storage module 340 is used to group the call bill flow data according to the number segment attribute through the rolling window based on the rolling window with the number segment attribute as the key value, and obtain the call bill file corresponding to each number segment attribute;

[0145] A construction module 330 is used to construct an index file of the call record file by mapping the number segment attribute corresponding to the call record file to the Bloom filter; the index file includes the number segment attribute and the file identifier of the call record file;

[0146] The storage module 340 is also used to store the call record file and the index file in association.

[0147] This embodiment can group the call bill flow data according to the number segment attributes corresponding to the number in the call bill based on the rolling window with the number segment attributes as the key value in the streaming framework, and obtain the call bill file corresponding to each number segment attribute. Since the call bill file corresponds to the number segment attributes, it is convenient to compress the call bill data with the same number segment attributes, and can reduce the possibility of multiple forms of call bill data corresponding to the same number being dispersed into multiple different files, thereby reducing the space occupied by the call bill storage and reducing the storage cost. At the same time, by constructing an index file through a Bloom filter, the storage space of the index file can be reduced, and the storage cost can be reduced.

[0148] In some embodiments, the storage module 340 is further configured to determine the size of each rolling window based on a preset time period;

[0149] Input the call bill flow data into at least one rolling window, and segment the call bill flow data according to the number segment attributes based on the size of the rolling window to obtain the call bill data corresponding to each number segment attribute within a preset time period;

[0150] Generate a call record file for the call record data corresponding to each number segment attribute within the preset time period.

[0151] In some embodiments, the storage module 340 is further used to sort the bill data corresponding to each number segment attribute within a preset time period according to a preset order;

[0152] According to the sorted call record data, a call record file is obtained.

[0153] In some embodiments, the construction module 330 is further used to obtain the number segment attribute corresponding to the call record file;

[0154] Based on the segment attributes, all numbers corresponding to the segment attributes are determined through the preset correspondence between numbers and segment attributes;

[0155] Through the preset hash function in the Bloom filter, all numbers are mapped to the array of the Bloom filter;

[0156] Serialize the array to get the index file.

[0157] In some embodiments, the determination module 320 is further configured to determine the degree of parallelism according to the type of the call record and the geographical location where the call record is generated.

[0158] In some embodiments, the acquisition module 310 is further used to send the call record data to the distributed message queue in parallel according to the parallelism.

[0159] In some embodiments, the storage module 340 is further used to compress the call record file according to a preset compression algorithm to obtain a compressed call record file;

[0160] The compressed call record file and index file are stored in association.

[0161] Figure 4 The various modules in the device shown can be implemented Figure 1 Each step in the above steps can achieve the corresponding technical effect, which will not be repeated here for the sake of brevity.

[0162] Figure 5 4 is a schematic diagram of a storage device 400 for a call record provided in an embodiment of the present application. Figure 5 As shown, the device may include a data acquisition module 410 , a determination module 420 , and a query module 430 .

[0163] The acquisition module 410 is used to acquire the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range;

[0164] The determination module 420 is used to determine the number segment attribute corresponding to the call record to be queried based on the number and through the preset correspondence between the number and the number segment attribute;

[0165] The determination module 420 is further used to determine the index file according to the segment attribute and the query time range; the index file is constructed by mapping the segment attribute corresponding to the call record file to the Bloom filter;

[0166] A query module 430 is used to perform Bloom filtering on the index file based on the number to obtain a call record file corresponding to the number;

[0167] The query module 430 is further used to traverse the call record data in the call record file and determine the call record to be queried based on the file identifier.

[0168] This embodiment implements the query of call records based on the storage method of the call records in the above embodiment. The corresponding segment attribute is determined by the number of the call record to be queried, and the index file is first searched according to the segment attribute and the query time range. The call record file is searched according to the index file to see whether it contains the call record file corresponding to the number to be searched, so as to achieve a "rough search" of the call record file. Then, all the call records in the corresponding call record file are traversed to achieve a "detailed search" of the call record file. Through the "rough search + detailed search" query method, the scope of the call record search is gradually narrowed, which can improve the search efficiency of the call record.

[0169] Figure 5 The various modules in the device shown can be implemented Figure 3 Each step in the above steps can achieve the corresponding technical effect, which will not be repeated here for the sake of brevity.

[0170] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0171] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.

[0172] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0173] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.

[0174] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.

[0175] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement any one of the methods for storing a call record in the above embodiments or to implement any one of the methods for querying a call record in the above embodiments.

[0176] In one example, the electronic device may further include a communication interface 503 and a bus 510. Figure 6 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.

[0177] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0178] Bus 510 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0179] In addition, in combination with the method for storing the bill in the above embodiment, the embodiment of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the methods for storing the bill in the above embodiment or any one of the methods for querying the bill in the above embodiment is implemented.

[0180] An embodiment of the present application also provides a computer program product, including a computer program, which, when processed and executed, implements any one of the call record storage methods in the above embodiments or any one of the call record query methods in the above embodiments.

[0181] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0182] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0183] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0184] The above reference is to the flowchart and / or block diagram of the method, device, equipment, storage medium and computer program product according to the embodiment of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0185] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for storing a call record. It is characterized in that include: Acquire call record data, wherein the call record data includes a number; Based on the number, determine the number segment attribute corresponding to the call record data through a preset correspondence relationship between the number and the number segment attribute; Sending the call record data to a distributed message queue to generate call record flow data; Based on a rolling window with the number segment attribute as a key value in the streaming framework, the call bill flow data is grouped according to the number segment attribute through the rolling window to obtain a call bill file corresponding to each number segment attribute; By mapping the number segment attribute corresponding to the call record file to the Bloom filter, an index file of the call record file is constructed; the index file includes the number segment attribute and the file identifier of the call record file; The call record file and the index file are stored in association with each other.

2. The method according to claim 1, It is characterized in that The rolling window based on the number segment attribute as the key value in the streaming framework, grouping the call bill flow data according to the number segment attribute through the rolling window, and obtaining the call bill file corresponding to each number segment attribute, includes: Determining the size of each of the rolling windows based on a preset time period; Input the call bill flow data into the rolling window, and segment the call bill flow data according to the number segment attributes based on the size of the rolling window to obtain the call bill data corresponding to each number segment attribute within the preset time period; Generate a call record file corresponding to the call record data corresponding to each number segment attribute within the preset time period.

3. The method according to claim 2, It is characterized in that The generating a call record file corresponding to the call record data corresponding to each number segment attribute within the preset time period includes: Sorting the call record data corresponding to each number segment attribute within the preset time period according to a preset order; According to the sorted call record data, a call record file is obtained.

4. The method according to any one of claims 1 to 3, It is characterized in that The step of mapping the number segment attribute corresponding to the call record file to a Bloom filter to construct an index file of the call record file includes: Obtain the number segment attribute corresponding to the call record file; Based on the number segment attribute, all numbers corresponding to the number segment attribute are determined through a preset correspondence between numbers and number segment attributes; Mapping all the numbers to the array of the Bloom filter through a hash function preset in the Bloom filter; The array is serialized to obtain an index file.

5. The method according to claim 1, It is characterized in that The call record data includes the type of the call record and the geographical location where the call record is generated; before sending the call record data to the distributed message queue, the method further includes: Determining the degree of parallelism according to the type of the call record and the geographical location where the call record is generated; The sending the call record data to a distributed message queue includes: The call record data is sent in parallel to the distributed message queue according to the parallelism.

6. The method according to claim 1, It is characterized in that The storing the call record file and the index file in association with each other includes: According to a preset compression algorithm, the call record file is compressed to obtain a compressed call record file; The compressed call record file and the index file are stored in association.

7. A method for querying a call record. It is characterized in that include: Obtain the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range; Based on the number, determine the number segment attribute corresponding to the call record to be queried through a preset correspondence between the number and the number segment attribute; Determine an index file according to the segment attribute and the query time range; the index file is constructed by mapping the segment attribute corresponding to the call record file to a Bloom filter; Performing Bloom filtering on the index file based on the number to obtain a call record file corresponding to the number; The call record data in the call record file is traversed, and the call record to be queried is determined based on the file identifier.

8. A storage device for a call record, It is characterized in that The device comprises: An acquisition module, used to acquire call bill data, wherein the call bill data includes a number; A determination module, configured to determine the number segment attribute corresponding to the call bill data based on the number and through a preset correspondence between the number and the number segment attribute; The acquisition module is further used to send the call bill data to a distributed message queue to generate call bill flow data; A storage module, which is used to group the bill flow data according to the number segment attribute based on a rolling window with the number segment attribute as a key value in a streaming framework, and obtain a bill file corresponding to each number segment attribute; A construction module, used to construct an index file of the call record file by mapping the number segment attribute corresponding to the call record file to a Bloom filter; the index file includes the number segment attribute and the file identifier of the call record file; The storage module is also used to store the call record file and the index file in association with each other.

9. A device for querying a call list, It is characterized in that The device comprises: An acquisition module, used to acquire the number of the call record to be queried, the file identifier of the call record to be queried, and the query time range; A determination module, used to determine the number segment attribute corresponding to the call record to be queried based on the number and through a preset correspondence between the number and the number segment attribute; The determination module is further used to determine the index file according to the segment attribute and the query time range; the index file is constructed by mapping the segment attribute corresponding to the call record file to the Bloom filter; A query module, configured to perform Bloom filtering on the index file based on the number to obtain a call record file corresponding to the number; The query module is further used to traverse the call record data in the call record file and determine the call record to be queried based on the file identifier.

10. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the method for storing the call record as described in any one of claims 1 to 6 or the method for querying the call record as described in claim 7.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the method for storing a call record as described in any one of claims 1 to 6 or the method for querying a call record as described in claim 7 is implemented.

12. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method for storing a call record as described in any one of claims 1 to 6 or implements the method for querying a call record as described in claim 7.

Citation Information

Patent Citations

  • Method and system for realizing storage and query of communication detailed ticket

    CN103020131A

  • File storing and indexing method and device as well as file reading method

    CN106874348A

  • Mass network data search method based on data stream structure

    CN107357843A

  • Multi-attribute index method based on data stream

    CN107368527A

  • A method and system for generating call ticket

    CN111224831A