Blacklist Number Verification Method Based on Bitmap Structure

By splitting blacklisted numbers into network identification numbers, regional codes, and last digits, and constructing a bitmap verification method with a hash structure, the problem of low efficiency in blacklisted number verification is solved, achieving a fast and resource-saving verification process that can adapt to complex data requirements.

CN118152376BActive Publication Date: 2026-11-17SHANGHAI YUNXIN LIUKE INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410409534.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-07
Publication Date
2026-11-17
Estimated Expiration
2044-04-07

AI Technical Summary

Technical Problem

Existing methods for verifying blacklisted phone numbers are inefficient and resource-intensive when processing massive amounts of data, and ordinary bitmap structures suffer from significant resource waste in sparse distribution scenarios.

Method used

A blacklist number verification method based on bitmap structure is adopted. The blacklist number is split into network identification number, regional code and last digit, and a first hash structure and a second hash structure are constructed. The bitmap structure is then combined for verification and updating.

Benefits of technology

It enables a rapid blacklist number verification process, saves storage space, reduces costs, improves processing efficiency, and has flexible library construction and update capabilities to adapt to data needs of different scales and complexities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118152376B_ABST
    Figure CN118152376B_ABST
Patent Text Reader

Abstract

This invention discloses a blacklist number verification method based on a bitmap structure, comprising: acquiring blacklist number data and constructing a blacklist database; initializing the blacklist database to obtain a target blacklist database with a bitmap structure; acquiring the number to be verified and performing initialization processing to obtain a target number to be verified; determining whether the target number to be verified exists in the target blacklist database, and obtaining the blacklist number verification result based on the determination result; enabling the blacklist database to reasonably allocate resources under high concurrency conditions and improving the efficiency of blacklist number verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication security and provides a method for verifying blacklisted phone numbers based on a bitmap structure. Background Technology

[0002] In this information age, we face information harassment from multiple channels and methods, and our subjective acceptance of information obtained through different means varies. Therefore, in this era of information overload, how to minimize the negative impact of commercial SMS on recipients and maintain its healthy development has become a question worth exploring.

[0003] In commercial SMS sending platforms, a common approach is to maintain multi-dimensional blacklist databases for different categories of SMS messages to prevent spam. Therefore, efficient blacklist detection is crucial. Current blacklist number verification methods commonly employ linear search, hash tables, relational and non-relational database indexes, and Bloom filters. While these methods achieve the desired functionality, they suffer from inefficiency, high resource consumption, and difficulty in effectively updating and maintaining data resources when handling massive numbers. Linear search requires comparing each number individually, which is time-consuming; while hash tables offer improved search speed, they require significant memory to store and can degrade performance in the event of hash collisions; database index verification consumes substantial memory and disk space, and their unstable query efficiency makes it difficult to support high-concurrency, stable, and efficient queries; Bloom filters save significant space and are highly efficient, but some prominent drawbacks are unacceptable in many situations, such as the inability to remove blacklisted numbers and the inability to guarantee 100% accuracy, as they are subject to certain judgment errors due to implementation limitations. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. Therefore, the purpose of this invention is to propose a blacklist number verification method based on a bitmap structure, to address the common problems of low detection performance and high server resource consumption under high concurrency in massive blacklist databases, and to avoid resource allocation waste caused by the sparse distribution of blacklist numbers in ordinary bitmap structures.

[0005] To achieve the above objectives, embodiments of the present invention propose a blacklist number verification method based on a bitmap structure, comprising:

[0006] Obtain blacklisted phone numbers and build a blacklist database;

[0007] Initialize the blacklist database to obtain the target blacklist database with a bitmap structure;

[0008] Obtain the number to be inspected and perform initialization processing to obtain the target number to be inspected;

[0009] Determine whether the target number to be verified exists in the target blacklist database, and obtain the verification result of the blacklist number based on the determination result.

[0010] Preferably, the initialization of the blacklist database to obtain a target blacklist database with a bitmap structure includes:

[0011] Each blacklist number in the blacklist database is split to obtain the network identification number, area code, and last digit of each blacklist number;

[0012] Use the network identification number corresponding to each blacklisted number as the first key, and the area code as the first retrieval value pointed to by the corresponding key to construct the first hash structure;

[0013] The area code corresponding to each blacklisted number is used as the second key, and the memory address of the bitmap stored in the last digit is used as the second retrieval value pointed to by the key to construct the second hash structure.

[0014] A target blacklist database with a bitmap structure is constructed based on the first hash structure and the second hash structure.

[0015] Preferably, the step of obtaining blacklisted phone number data and constructing a blacklist database includes:

[0016] Obtain the blacklisted numbers, check for duplicates and delete invalid or incorrectly formatted numbers to obtain the processed blacklisted numbers; build a blacklist database based on the processed blacklisted numbers.

[0017] Preferably, the process involves acquiring the number to be inspected and performing initialization to obtain the target number to be inspected, including:

[0018] Obtain the number to be verified and split it into three parts: the first three digits of the number to be verified are used as the network identification number to be verified; the fourth to seventh digits of the number to be verified are used as the area code to be verified; and the last four digits of the number to be verified are used as the tail number to be verified.

[0019] The network identification number to be inspected, the area code to be inspected, and the last digit to be inspected are used as the target number to be inspected.

[0020] Preferably, the step of determining whether the target number to be verified exists in the target blacklist database, and obtaining the blacklist number verification result based on the determination result, includes:

[0021] The target blacklist database is queried based on the target number to be verified.

[0022] If the network identification number to be tested does not exist in the target blacklist database, then the number to be tested is determined to be a non-blacklist number.

[0023] If the target blacklist database contains the code of the region to be inspected corresponding to the network identification number to be inspected, then continue to search for the storage bitmap in the tail number to be inspected corresponding to the network identification number to be inspected.

[0024] If the value of the corresponding bit in the storage bitmap is 0, then the number to be checked is determined to be a non-blacklist number;

[0025] If the value of the corresponding bit in the storage bitmap is 1, then the number to be checked is determined to be a blacklist number.

[0026] Preferably, it also includes obtaining user feedback information at preset time intervals and updating the target blacklist database based on the user feedback information; the update includes adding blacklist markers and deleting blacklist markers.

[0027] The step of obtaining user feedback information at preset time intervals and updating the target blacklist database based on the user feedback information includes:

[0028] User feedback information is obtained at preset time intervals, and the feedback information is classified to obtain feedback information on blacklist markers to be added and blacklist markers to be deleted.

[0029] The numbers of feedback information to be added to the blacklist and the numbers of feedback information to be deleted from the blacklist are extracted and cleaned to obtain the numbers to be added to the blacklist and the numbers to be deleted from the blacklist.

[0030] The blacklisted number to be added is verified against the target blacklist database. If it is determined that the blacklisted number to be added is not recorded in the target blacklist database, the network identification number in the blacklisted number to be added is used as the first key in the first hash structure, and the area code in the blacklisted number to be added is used as the first retrieval value pointed to by the corresponding key. In the second hash structure, the area code in the blacklisted number to be added is used as the second key, and the memory address of the storage bitmap of the last digit in the blacklisted number to be added is used as the second retrieval value pointed to by the key. The bit in the bitmap where the last digit in the blacklisted number to be added is determined according to the last digit in the blacklisted number to be added, and the bit is set from 0 to 1.

[0031] The blacklist marker number to be deleted is queried based on the target blacklist database to determine the bit in the bitmap corresponding to the blacklist marker number to be deleted. The bit in the bitmap is changed from 1 to 0. At the same time, it is checked whether the data in the tail number storage bitmap corresponding to the blacklist marker number to be deleted are all 0. If it is determined that they are all 0, the area code corresponding to the blacklist marker number to be deleted in the first hash structure and the area code corresponding to the blacklist marker number to be deleted in the second hash structure are deleted. The tail number storage bitmap corresponding to the blacklist marker number to be deleted in the second hash structure is also deleted.

[0032] Complete the update of the target blacklist database.

[0033] Preferably, the execution strategy of the judgment module is adjusted and optimized during the process of the judgment module judging whether the target number to be checked exists in the target blacklist database;

[0034] The execution strategy of the judgment module has been adjusted and optimized, including:

[0035] Obtain several numbers to be verified, classify these numbers based on network identification numbers to obtain several number categories; extract network identification numbers from these number categories to obtain network identification numbers to be optimized.

[0036] Based on the network identifier to be optimized, obtain the inspection information within the corresponding historical time period in the target blacklist database; based on the inspection information, determine the inspection time evaluation value corresponding to the network identifier to be optimized;

[0037] Obtain the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information; determine the inspection impact value corresponding to the network identifiers to be optimized based on the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information;

[0038] Based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined.

[0039] The target test values ​​are sorted from largest to smallest to obtain the sorting results. The execution strategy of the judgment module is then adjusted and optimized based on the sorting results.

[0040] Preferably, based on the inspection information, the inspection time evaluation value corresponding to the network identification number to be optimized is determined, including:

[0041] Obtain the number of checks for the network identification number to be optimized within the corresponding historical time period in the target blacklist database, as well as the check time for each last digit of the network identification number to be optimized.

[0042] Based on the number of checks corresponding to the network identification number to be optimized within the corresponding historical time period in the target blacklist database and the check time of each last digit in the network identification number to be optimized, the check time evaluation value corresponding to the network identification number to be optimized is determined based on formula (1).

[0043]

[0044] Among them, H i (t) represents the evaluation value of the verification time of the i-th network identifier within a historical time period t in the target blacklist database; This represents the number of times the j-th region code in the i-th network identifier has been tested within the historical time period t; This represents the verification time of the a-th last digit of the j-th region code within the historical time period t; n represents the total number of last digits in the j-th region code; m represents the total number of region codes in the i-th network identifier; n! represents the factorial of n, and (ni)! represents the factorial of ni.

[0045] Preferably, determining the inspection impact value corresponding to the network identification number to be optimized based on the number of network identification numbers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections in the inspection information includes:

[0046] Based on formula (2), the test impact value corresponding to the network identification number to be optimized is determined;

[0047]

[0048] Z represents the impact value of the test; m represents the total number of region codes in the i-th network identifier; l represents the number of network identifiers to be optimized. j Q represents the actual number of tests corresponding to the j-th historical region code in the current network identifier, and Q represents the estimated test time corresponding to the current network identifier. j This represents the actual verification time corresponding to the j-th historical region code of the current network identification number. This represents the verification time of the a-th digit of the current network identifier in the j-th region code within the historical time period t, where n represents the total number of digits in the j-th region code.

[0049] Preferably, determining the target inspection order value of the network identifier to be optimized based on the inspection time evaluation value and inspection impact value corresponding to the network identifier to be optimized includes:

[0050] Based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined according to formula (3);

[0051]

[0052] Among them, S i (t) represents the target inspection order value of the network identifier at time t; H i (t) represents the evaluation value of the inspection time of the i-th network identification number to be inspected within the historical time period t in the target blacklist database; Z represents the inspection impact value, and n represents the total number of tail numbers in the j-th area code.

[0053] The beneficial effects of this invention are: using a bitmap structure to store blacklist number data enables a rapid verification process, saving time and improving processing efficiency; the bitmap structure occupies relatively little space when storing the blacklist database, saving storage resources and reducing costs; initializing and verifying the blacklist database through a bitmap structure can accurately determine whether the target number to be verified is in the blacklist database; the construction and updating of the blacklist database is flexible, with low maintenance costs and simple operation; it has strong scalability, can cope with blacklist number data needs of different scales and complexities, and meet constantly changing business needs;

[0054] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0055] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0056] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0057] Figure 1 This is a flowchart of a blacklist number verification method based on a bitmap structure according to an embodiment of the present invention;

[0058] Figure 2 This is a schematic diagram illustrating the deletion of blacklisted numbers according to an embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of a blacklist number according to an embodiment of the present invention;

[0060] Figure 4 This is a flowchart illustrating the process of determining whether something is on a blacklist according to an embodiment of the present invention. Detailed Implementation

[0061] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0062] Through the bitmap data structure, we know that each bit represents an element. Therefore, the relationship between the length of the bitmap and the memory usage is linear. Specifically, if we assume the bitmap length is n, then its memory usage (in bytes) can be expressed by the formula: bytes = n / 8. As the bitmap length increases, the memory usage will increase linearly. For an 11-digit mobile phone number, a bitmap of length 19999999999 is needed to completely cover it. Using the formula mentioned above, 19999999999 (bits) / 8 / 1024 = 2384.2M, which is approximately 2384M of memory space, which is undoubtedly unacceptable. Analysis shows that in this 19999999999 bitmap, the actual blacklist numbers are sparsely stored. Many positions correspond to numbers that are not on the blacklist, but still require space, and the corresponding values ​​are stored as 0, leading to a significant waste of storage space. To address this issue, each blacklisted number is split into three parts: the first three digits correspond to the network identification number, digits four through seven correspond to the area code of the number, and the last four digits correspond to the last four digits of the number, such as... Figure 4 As shown; after splitting, two hash structures need to be constructed. In the first hash structure, the network identification number is used as the key, and the region code is used as the retrieval value pointed to by the corresponding key. In the second hash structure, the region code is used as the key, and the memory address of the last digit of the container is used as the retrieval value pointed to by the key.

[0063] Currently, network identification numbers include:

[0064] The numbers 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 145, 147, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 166, 170, 171, 172, 173, 175, 176, 177, 178, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 198, and 199 total 43. The combination of network identification number and area code is approximately 371,562. These are only pre-allocated home number ranges, a large portion of which are not actually opened for public use. If we assume all number segments are already open for use, and each open number is a blacklisted number, then under this extreme scenario, the maximum memory required for this storage method is 9999 / 8 / 1024 / 1024*371562 = 442M. If we don't use a bitmap method for the last four digits, but instead directly store 9999 four-digit integers, the maximum memory required is 9999*8 / 1024 / 1024*371562 = 28345M. If we don't split the number into three parts, but instead split it into two parts, with the first part still being the network identifier and the second part being the last eight digits, the maximum memory required for the last eight digits using a smaller bitmap structure is 99999999 / 8 / 1024 / 1024*43 = 512.5M. If we don't use a bitmap structure, the maximum memory required is 99999999*8 / 1024 / 1024*43 = 32806M. If we don't split the number and directly store all the numbers in these ranges, the maximum memory required is 371562*9999*8 / 1024 / 1024 = 28345M.

[0065] By splitting the number into three parts, the network identification number points to the list of area codes contained in the identification number. Since the area code is a four-digit number, we can quickly search and confirm it. After finding the area code, we can obtain the storage bitmap Container of the last digit of the area code. Through the last digit, we find the value of the last digit in the corresponding position of the Container. 1 indicates that the number being searched is a blacklist number, and 0 indicates that it is not a blacklist number.

[0066] Example 1

[0067] like Figure 1 As shown: A blacklist number verification method based on bitmap structure, including:

[0068] S1: Obtain blacklisted phone numbers and build a blacklist database;

[0069] S2: Initialize the blacklist database to obtain the target blacklist database with a bitmap structure;

[0070] S3: Obtain the number to be inspected and perform initialization processing to obtain the target number to be inspected;

[0071] S4: Determine whether the target number to be checked exists in the target blacklist database, and obtain the blacklist number verification result based on the judgment result.

[0072] In this embodiment, the bitmap structure is a data structure in which each bit can only store binary 0 or 1, thus saving a lot of memory space. For example, in a blacklist number database, a bitmap structure can be used, where one bit represents a possible blacklist number. When a number exists in the blacklist, the corresponding bit is set to 1, otherwise it is 0. In this way, it is possible to quickly check whether a number is in the blacklist using bitwise operations, without having to store a large amount of actual number data.

[0073] In this embodiment, the target blacklist database with a bitmap structure includes a first hash structure and a second hash structure.

[0074] In this embodiment, the target number to be inspected includes the network identification number to be inspected, the area code to be inspected, and the last digit to be inspected.

[0075] In this embodiment, the target blacklist database with a bitmap structure also includes the network identification number, area code, and last digit of each blacklist number.

[0076] In this embodiment, the verification result includes whether the number to be verified is a non-blacklisted number or a blacklisted number.

[0077] The beneficial effects of the above technical solution are as follows: using a bitmap structure to store blacklist number data enables a rapid verification process, saving time and improving processing efficiency; the bitmap structure occupies relatively little space when storing the blacklist database, saving storage resources and reducing costs; initializing and verifying the blacklist database through a bitmap structure can accurately determine whether the target number to be verified is in the blacklist database, effectively avoiding missed detections and false detections; the construction and updating of the blacklist database is relatively flexible, with low maintenance costs and simple operation; it has strong scalability, can cope with blacklist number data needs of different scales and complexities, and meet constantly changing business needs.

[0078] Example 2

[0079] The initialization of the blacklist database, resulting in a target blacklist database with a bitmap structure, includes:

[0080] Each blacklist number in the blacklist database is split to obtain the network identification number, area code, and last digit of each blacklist number;

[0081] Use the network identification number corresponding to each blacklisted number as the first key, and the area code as the first retrieval value pointed to by the corresponding key to construct the first hash structure;

[0082] The area code corresponding to each blacklisted number is used as the second key, and the memory address of the bitmap stored in the last digit is used as the second retrieval value pointed to by the key to construct the second hash structure.

[0083] A target blacklist database with a bitmap structure is constructed based on the first hash structure and the second hash structure.

[0084] In this embodiment, each blacklist number in the blacklist database is split into three parts: the first three digits of each blacklist number are used as the network identification number; the fourth to seventh digits of each blacklist number are used as the area code; and the last four digits of each blacklist number are used as the last four digits.

[0085] In this embodiment, in the hash structure, the key is an index value used for storing and retrieving data. After being calculated by a hash function, it is mapped to a specific location in the hash table for fast data lookup. The lookup value is the corresponding numerical value or data found in the hash table based on the given key. Specifically, when using a hash structure for data storage, firstly, the corresponding hash value is calculated using a hash function based on the data's key, and then the data is stored in the hash table at the location determined by the hash value. When data needs to be retrieved, the hash value is also calculated based on the key, and then the data stored at the corresponding location in the hash table is searched to obtain the lookup value.

[0086] For a simple example, in a hash table of phone numbers, the phone number can be used as a key. When you need to find the user information corresponding to a specific phone number, you first calculate the hash value based on the phone number, then look up the data at the corresponding position in the hash table, and retrieve the user information as the search value.

[0087] In this embodiment, constructing a target blacklist database with a bitmap structure can improve the storage and retrieval efficiency of blacklist data to a certain extent, especially in the case of large-scale data processing. By combining hash structures and bitmap structures, their respective advantages can be leveraged to achieve more efficient blacklist management. The first hash structure can map blacklist numbers to corresponding hash table positions, enabling fast insertion and query operations. This effectively reduces the time complexity of data lookup and improves the processing speed of blacklist data; combined with a bitmap structure, the blacklist data set can be represented more compactly. The bitmap structure can store a large amount of Boolean data in a small storage space, representing the presence or absence of blacklist numbers in bit form, occupying less memory space. The constructed target blacklist database with a bitmap structure can achieve efficient management and retrieval of large-scale blacklist data sets with low memory overhead, while maintaining high data processing speed. This not only saves storage space and reduces costs but also improves system performance and response speed.

[0088] In this embodiment, by constructing a first hash structure and a second hash structure, during the blacklist number verification process, the first hash structure is used for verification first. If the verification result does not contain the area code corresponding to the number to be verified, the number to be verified is determined to be a non-blacklist number. This reduces the overall computational load of the verification and shortens the computation time of the verification result. If the verification result contains the area code corresponding to the number to be verified, the second hash structure is used for verification. Distributed verification helps to reduce the overall computational load of the verification and improves the efficiency of the verification.

[0089] The beneficial effects of the above technical solution are as follows: Constructing a target blacklist database with a bitmap structure based on the first hash structure and the second hash structure can bring multiple benefits to blacklist management, including improved storage and retrieval efficiency, saving storage space, accelerating blacklist matching speed, and facilitating system expansion and maintenance. By splitting the blacklist numbers and constructing the first and second hash structures, efficient storage and retrieval of blacklist data can be achieved. The combination of the fast lookup capability of the hash structure and the compact storage method of the bitmap structure improves the management efficiency of blacklist data; the bitmap structure can represent a large amount of data with a small storage space, effectively saving memory usage. By constructing a blacklist database with a bitmap structure, storage costs can be reduced to a certain extent; constructing a blacklist database with a bitmap structure makes the system easier to expand and maintain. When it is necessary to add blacklist numbers or make updates, the data structure can be adjusted and managed more quickly.

[0090] Example 3

[0091] The process of obtaining blacklisted phone number data and constructing a blacklist database includes:

[0092] Obtain the blacklisted numbers, check for duplicates and delete invalid or incorrectly formatted numbers to obtain the processed blacklisted numbers; build a blacklist database based on the processed blacklisted numbers.

[0093] The beneficial effects of the above technical solution are as follows: Cleaning blacklist data can effectively remove duplicate, invalid, or incorrectly formatted numbers, ensuring the accuracy of the data in the blacklist database. This reduces the probability of false positives and ensures the accuracy of blacklist matching; removing duplicate blacklist numbers reduces data redundancy and saves storage space. The cleaned blacklist database will be more compact and occupy less memory space; through cleaning and deduplication operations, the amount of data in the blacklist database can be reduced, lowering the time complexity of queries and improving the query efficiency of blacklist data. This will help speed up blacklist matching; removing invalid or incorrectly formatted numbers can avoid errors during blacklist matching, improving system stability and reliability. Cleaning data can reduce the possibility of system errors and ensure the normal operation of the system.

[0094] Example 4

[0095] Obtain the number to be inspected and perform initialization processing to obtain the target number to be inspected, including:

[0096] Obtain the number to be verified and split it into three parts: the first three digits of the number to be verified are used as the network identification number to be verified; the fourth to seventh digits of the number to be verified are used as the area code to be verified; and the last four digits of the number to be verified are used as the tail number to be verified.

[0097] The network identification number to be inspected, the area code to be inspected, and the last digit to be inspected are used as the target number to be inspected.

[0098] In this embodiment, the number to be verified is split into the network identification number to be verified, the area code to be verified, and the last digit to be verified. The segmented retrieval helps to speed up the verification process.

[0099] The beneficial effects of the above technical solution are as follows: By splitting the number to be verified and extracting the network identification number, area code, and last digit separately, the number can be divided according to different information, facilitating subsequent matching and query operations; obtaining standardized target numbers to be verified through initialization processing helps reduce data errors and confusion, improving the accuracy of the numbers to be verified. Ensuring that the data conforms to a standard format is beneficial for subsequent processing and analysis; splitting the number to be verified and extracting the network identification number, area code, and last digit allows the number to be classified according to different levels of information, helping to optimize the matching algorithm and improve matching efficiency; splitting the number to be verified into the network identification number, area code, and last digit makes subsequent processing, analysis, or operations, such as comparing with data in the blacklist database, easier.

[0100] Example 5

[0101] The process of determining whether the target blacklist exists in the target blacklist database and obtaining the blacklist number verification result based on the determination result includes:

[0102] The target blacklist database is queried based on the target number to be verified.

[0103] If the network identification number to be tested does not exist in the target blacklist database, then the number to be tested is determined to be a non-blacklist number.

[0104] If the target blacklist database contains the code of the region to be inspected corresponding to the network identification number to be inspected, then continue to search for the storage bitmap in the tail number to be inspected corresponding to the network identification number to be inspected.

[0105] If the value of the corresponding bit in the storage bitmap is 0, then the number to be checked is determined to be a non-blacklist number;

[0106] If the value of the corresponding bit in the storage bitmap is 1, then the number to be checked is determined to be a blacklist number.

[0107] In this embodiment, the first matching is performed by matching the area code to be checked in the target number to be checked with the area code in the target blacklist database. The second matching is performed if the area code to be checked exists in the first matching result. The second matching is performed by searching the storage bitmap in the tail number corresponding to the network identification number to be checked. The two matchings reduce the amount of computation for the inspection and improve the efficiency of the inspection.

[0108] The beneficial effects of the above technical solution are as follows: By querying the network identification number and area code of the target number to be checked in the blacklist database, potential blacklisted number segments can be quickly located, accelerating the matching speed. Through meticulous process judgment, including finding the area code corresponding to the network identification number and judging the value in the stored bitmap, it is possible to accurately determine whether the number to be checked is a blacklisted number, reducing the false positive rate. Grouping and querying numbers by network identification number and area code can effectively filter out numbers that do not meet the conditions, reducing the amount of data processed subsequently and improving efficiency. Judging whether the number to be checked is a blacklisted number by the value in the stored bitmap can save storage space and computing resources, avoid unnecessary comparison operations, and optimize the overall system performance. Real-time updating of the blacklisted number's stored bitmap in the blacklist database can ensure the accuracy and timeliness of the query results, guaranteeing the effectiveness of blacklisted number verification.

[0109] Example 6

[0110] like Figure 2As shown: User feedback information is obtained at preset time intervals, and the target blacklist database is updated based on the user feedback information; the update includes adding blacklist tags and deleting blacklist tags;

[0111] The step of obtaining user feedback information at preset time intervals and updating the target blacklist database based on the user feedback information includes:

[0112] User feedback information is obtained at preset time intervals, and the feedback information is classified to obtain feedback information on blacklist markers to be added and blacklist markers to be deleted.

[0113] The numbers of feedback information to be added to the blacklist and the numbers of feedback information to be deleted from the blacklist are extracted and cleaned to obtain the numbers to be added to the blacklist and the numbers to be deleted from the blacklist.

[0114] The blacklisted number to be added is verified against the target blacklist database. If it is determined that the blacklisted number to be added is not recorded in the target blacklist database, the network identification number in the blacklisted number to be added is used as the first key in the first hash structure, and the area code in the blacklisted number to be added is used as the first retrieval value pointed to by the corresponding key. In the second hash structure, the area code in the blacklisted number to be added is used as the second key, and the memory address of the storage bitmap of the last digit in the blacklisted number to be added is used as the second retrieval value pointed to by the key. The bit in the bitmap where the last digit in the blacklisted number to be added is determined according to the last digit in the blacklisted number to be added, and the bit is set from 0 to 1.

[0115] The blacklist marker number to be deleted is queried based on the target blacklist database to determine the bit in the bitmap corresponding to the blacklist marker number to be deleted. The bit in the bitmap is changed from 1 to 0. At the same time, it is checked whether the data in the tail number storage bitmap corresponding to the blacklist marker number to be deleted are all 0. If it is determined that they are all 0, the area code corresponding to the blacklist marker number to be deleted in the first hash structure and the area code corresponding to the blacklist marker number to be deleted in the second hash structure are deleted. The tail number storage bitmap corresponding to the blacklist marker number to be deleted in the second hash structure is also deleted.

[0116] Complete the update of the target blacklist database.

[0117] In this embodiment, a feedback entry point will be provided during actual application to receive user feedback information on phone numbers. The feedback information includes feedback information on adding to the blacklist and feedback information on deleting from the blacklist.

[0118] In this embodiment, the preset time period can be 7 days, 15 days, or 1 month.

[0119] In this embodiment, the feedback information includes text records and phone number records, so the phone number in the feedback information is extracted.

[0120] In this embodiment, the process of adding a blacklisted number involves inputting the network identification number, area code, and last digit of the blacklisted number into the corresponding positions in the target blacklist database.

[0121] In this embodiment, the process of deleting the blacklisted number to be deleted involves changing the bit in the bitmap corresponding to the blacklisted number to be deleted from 1 to 0.

[0122] The beneficial effects of the above technical solution are as follows: By acquiring and updating user feedback information at preset intervals, the real-time performance and accuracy of the blacklist database can be maintained, promptly reflecting user needs and feedback; classifying user feedback information to obtain numbers to be added to and deleted from the blacklist helps to handle different situations appropriately, improving processing efficiency; extracting and cleaning the numbers to be added to and deleted from the blacklist ensures the standardization and accuracy of the data format, avoiding errors and confusion; using a hash structure for verification and update operations allows for quick location of numbers to be added to and deleted from the blacklist, and corresponding marking operations are performed in the blacklist database, improving update efficiency and speed; managing the status of blacklist numbers through a bitmap storage method saves storage space, improves memory utilization, and enables fast search and update operations; through the design of the first and second hash structures, blacklist numbers are classified and managed according to network identification number, regional code, and last digit, ensuring a clear data structure and facilitating retrieval and updates.

[0123] Example 7

[0124] In the process of the judgment module determining whether the target number to be verified exists in the target blacklist database, the execution strategy of the judgment module is adjusted and optimized;

[0125] The execution strategy of the judgment module has been adjusted and optimized, including:

[0126] Obtain several numbers to be verified, classify these numbers based on network identification numbers to obtain several number categories; extract network identification numbers from these number categories to obtain network identification numbers to be optimized.

[0127] Based on the network identifier to be optimized, obtain the inspection information within the corresponding historical time period in the target blacklist database; based on the inspection information, determine the inspection time evaluation value corresponding to the network identifier to be optimized;

[0128] Obtain the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information; determine the inspection impact value corresponding to the network identifiers to be optimized based on the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information;

[0129] Based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined.

[0130] The target test values ​​are sorted from largest to smallest to obtain the sorting results. The execution strategy of the judgment module is then adjusted and optimized based on the sorting results.

[0131] In this embodiment, during the process of the judgment module determining whether the target number to be verified exists in the target blacklist database, the received verification request tasks are multi-source, multi-terminal parallel requests. When a large number of requests are received at the same time, the judgment module will inevitably cause network congestion when performing verification based on a sequential execution strategy. This will result in users being unable to quickly obtain verification results after requesting verification, leading to a very poor user experience. To solve this problem, the execution strategy of the judgment module is adjusted and optimized. When a large number of request information is obtained at the same time, the judgment module analyzes the verification request information, extracts the network identification number from the request information, queries the verification information within the historical time period based on the network identification number in the request information, determines the target verification order value of the network identification number to be optimized based on the verification information, sorts the target verification order value from largest to smallest, obtains the sorting result, selects the top M positions of the sorting order, retrieves the corresponding data into the cache and sets an appropriate expiration time. The cache can be a memory cache (such as Redis, Memcached) or an application-level cache. This can ensure a fast response and processing for important and high-demand network identification numbers. By caching data, the frequent access to resources such as the database can be reduced, the system load can be reduced, and the overall performance can be further optimized.

[0132] In this embodiment, several numbers to be verified are classified based on network identification numbers to obtain several categories of numbers to be verified. For example, if the numbers to be verified are 134xxxx1234, 134xxxx4567, and 138xxxx5678, and the corresponding network identification numbers are 134, 134, and 138, then 134xxxx1234 and 134xxxx4567 are classified into one category, and 138xxxx5678 is classified into another category.

[0133] In this embodiment, network identification numbers are extracted from several number categories to be verified to obtain network identification numbers to be optimized; for example, the network identification numbers to be optimized extracted from 134xxxx1234, 134xxxx4567, and 138xxxx5678 are 134 and 138, respectively.

[0134] In this embodiment, the evaluation value of the inspection time is determined based on the inspection time and number of inspections within the corresponding historical time period obtained from the target blacklist database using the network identification number to be optimized.

[0135] In this embodiment, the execution strategy of the judgment module is adjusted and optimized according to the sorting result. Based on the sorting result, the test data corresponding to the first M positions in the sorting result is cached. For the remaining data in the sorting result, different strategies can be used for processing, such as batch processing, asynchronous processing, or delayed processing. For example, an asynchronous processing framework (such as SpringAsync, Celery, etc.) can be used to put the processing task of the remaining data into a background thread or task queue to achieve non-blocking processing.

[0136] The beneficial effects of the above technical solution are as follows: By classifying the numbers to be inspected and extracting the network identification numbers, the network identification numbers to be optimized can be determined more effectively, thereby obtaining their historical inspection information. Based on this information, the inspection time evaluation value and inspection impact value of the network identification numbers to be optimized can be calculated, thus determining their target inspection order value. According to the target inspection order value, those ranked higher are cached for priority processing, thereby improving overall processing efficiency. By comprehensively considering the inspection time evaluation value and inspection impact value of the network identification numbers to be optimized, inspection resources can be allocated more rationally. For numbers to be inspected with high inspection time evaluation values ​​or high inspection impact values, more resources or priority can be allocated. By optimizing the execution strategy, inspection time can be reduced and inspection efficiency improved. The optimized execution strategy can process user requests more quickly, reduce user waiting time, and improve user satisfaction and experience. By adjusting and optimizing the execution strategy of the judgment module, it is possible to better cope with peak traffic surges, reduce the possibility of system congestion and crashes, and enhance the stability and reliability of the system.

[0137] Example 8

[0138] Based on the inspection information, the inspection time evaluation value corresponding to the network identification number to be optimized is determined, including:

[0139] Obtain the number of checks for the network identification number to be optimized within the corresponding historical time period in the target blacklist database, as well as the check time for each last digit of the network identification number to be optimized.

[0140] Based on the number of checks corresponding to the network identification number to be optimized within the corresponding historical time period in the target blacklist database and the check time of each last digit in the network identification number to be optimized, the check time evaluation value corresponding to the network identification number to be optimized is determined based on formula (1).

[0141]

[0142] Among them, H i(t) represents the evaluation value of the verification time of the i-th network identifier within a historical time period t in the target blacklist database; This represents the number of times the j-th region code in the i-th network identifier has been tested within the historical time period t; This represents the verification time of the a-th last digit of the j-th region code within the historical time period t; n represents the total number of last digits in the j-th region code; m represents the total number of region codes in the i-th network identifier; n! represents the factorial of n, and (ni)! represents the factorial of ni.

[0143] The beneficial effects of the above technical solution are as follows: By calculating the verification time evaluation value of each network identification number, the verification status of that network identification number within the historical time period t can be reflected more accurately. This helps the judgment module to perform personalized processing based on the characteristics of the network identification number, improving the targeting and efficiency of the processing; it comprehensively considers the number of verifications and verification times of different regional codes and last digits within the historical time period. This consideration of regional characteristics helps the judgment module to more accurately grasp the verification characteristics of different regions or last digits, thereby optimizing the processing strategy. It can handle more complex verification situations, such as combinations of multiple last digits or regional codes. This helps the judgment module to more accurately evaluate and process when facing complex verification scenarios; it can dynamically reflect changes in the verification status in the blacklist database. This allows the judgment module to adjust its execution strategy in real time according to the actual situation to adapt to constantly changing verification needs. By comprehensively considering information such as verification time evaluation value, number of verifications, and verification time, verification resources can be allocated more rationally. For network identification numbers with high verification time evaluation values ​​or frequent verifications, priority can be given to processing or increased resource investment can be made to improve overall processing efficiency.

[0144] Example 9

[0145] The determination of the inspection impact value corresponding to the network identification number to be optimized based on the number of network identification numbers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections in the inspection information includes:

[0146] Based on formula (2), the test impact value corresponding to the network identification number to be optimized is determined;

[0147]

[0148] Z represents the impact value of the test; m represents the total number of region codes in the i-th network identifier; l represents the number of network identifiers to be optimized. j Q represents the actual number of tests corresponding to the j-th historical region code in the current network identifier, and Q represents the estimated test time corresponding to the current network identifier. Q j represents the actual verification time corresponding to the j-th historical region code of the current network identification number. This represents the verification time of the a-th digit of the current network identifier in the j-th region code within the historical time period t, where n represents the total number of digits in the j-th region code.

[0149] The beneficial effects of the above technical solution are: it comprehensively considers factors such as the impact value of the verification, the regional coding situation in the network identification number, the actual number of verifications, the estimated verification time, the actual verification time, and the last digit verification time to evaluate the optimization effect of the identification number. By comprehensively considering these factors, the performance and effect of the network identification number can be analyzed more comprehensively, thereby guiding the optimization strategy.

[0150] Example 10

[0151] The determination of the target inspection order value for the network identification number to be optimized, based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, includes:

[0152] Based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined according to formula (3);

[0153]

[0154] Among them, S i (t) represents the target inspection order value of the network identifier at time t; H i (t) represents the evaluation value of the inspection time of the i-th network identification number to be inspected within the historical time period t in the target blacklist database; Z represents the inspection impact value, and n represents the total number of tail numbers in the j-th area code.

[0155] The beneficial effects of the above technical solution are: it integrates the verification time evaluation value, verification impact value, and the total number of last digits in the regional code of the target network identifier to calculate the target verification order value of the network identifier. By calculating the sum of the target verification order values ​​of each network identifier, the overall optimization effect of the network identifier to be optimized can be evaluated. This comprehensive index helps to determine the priority order of network identifiers, thereby guiding subsequent optimization work and decision-making.

[0156] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for verifying blacklisted phone numbers based on a bitmap structure, characterized in that, include: Obtain blacklisted phone numbers and build a blacklist database; Initialize the blacklist database to obtain the target blacklist database with a bitmap structure; Obtain the number to be inspected and perform initialization processing to obtain the target number to be inspected; Determine whether the target number to be verified exists in the target blacklist database, and obtain the verification result of the blacklist number based on the determination result; The initialization of the blacklist database, resulting in a target blacklist database with a bitmap structure, includes: Each blacklist number in the blacklist database is split to obtain the network identification number, area code, and last digit of each blacklist number; Use the network identification number corresponding to each blacklisted number as the first key, and the area code as the first retrieval value pointed to by the corresponding key to construct the first hash structure; The area code corresponding to each blacklisted number is used as the second key, and the memory address of the bitmap stored in the last digit is used as the second retrieval value pointed to by the key to construct the second hash structure. Construct a target blacklist database with a bitmap structure based on the first hash structure and the second hash structure; In the process of the judgment module determining whether the target number to be verified exists in the target blacklist database, the execution strategy of the judgment module is adjusted and optimized; The execution strategy of the judgment module has been adjusted and optimized, including: Obtain several numbers to be verified, classify these numbers based on network identification numbers to obtain several number categories; extract network identification numbers from these number categories to obtain network identification numbers to be optimized. Based on the network identifier to be optimized, obtain the inspection information within the corresponding historical time period in the target blacklist database; based on the inspection information, determine the inspection time evaluation value corresponding to the network identifier to be optimized; Obtain the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information; determine the inspection impact value corresponding to the network identifiers to be optimized based on the number of network identifiers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections from the inspection information; Based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined. The target test values ​​are sorted from largest to smallest to obtain the sorting result. The test data corresponding to the first M positions in the sorting result are put into the cache. For the remaining data in the sorting result, different strategies can be used for processing.

2. The blacklist number verification method based on bitmap structure according to claim 1, characterized in that, The process of obtaining blacklisted phone number data and constructing a blacklist database includes: Obtain the blacklisted numbers, check for duplicates and delete invalid or incorrectly formatted numbers to obtain the processed blacklisted numbers; build a blacklist database based on the processed blacklisted numbers.

3. The blacklist number verification method based on bitmap structure according to claim 1, characterized in that, Obtain the number to be inspected and perform initialization processing to obtain the target number to be inspected, including: Obtain the number to be verified and split it into three parts: the first three digits of the number to be verified are used as the network identification number to be verified; the fourth to seventh digits of the number to be verified are used as the area code to be verified; and the last four digits of the number to be verified are used as the tail number to be verified. The network identification number to be inspected, the area code to be inspected, and the last digit to be inspected are used as the target number to be inspected.

4. The blacklist number verification method based on bitmap structure according to claim 3, characterized in that, The process of determining whether the target blacklist exists in the target blacklist database and obtaining the blacklist number verification result based on the determination result includes: The target blacklist database is queried based on the target number to be verified; If the network identification number to be tested does not exist in the target blacklist database, then the number to be tested is determined to be a non-blacklist number. If the target blacklist database contains the code of the region to be inspected corresponding to the network identification number to be inspected, then continue to search for the storage bitmap in the tail number to be inspected corresponding to the network identification number to be inspected. If the value of the corresponding bit in the storage bitmap is 0, then the number to be checked is determined to be a non-blacklist number; If the value of the corresponding bit in the storage bitmap is 1, then the number to be checked is determined to be a blacklist number.

5. The blacklist number verification method based on bitmap structure according to claim 1, characterized in that, It also includes obtaining user feedback information at preset time intervals and updating the target blacklist database based on the user feedback information; the update includes adding blacklist markers and deleting blacklist markers. The step of obtaining user feedback information at preset time intervals and updating the target blacklist database based on the user feedback information includes: User feedback information is obtained at preset time intervals, and the feedback information is classified to obtain feedback information on blacklist markers to be added and blacklist markers to be deleted. The numbers of feedback information to be added to the blacklist and the numbers of feedback information to be deleted from the blacklist are extracted and cleaned to obtain the numbers to be added to the blacklist and the numbers to be deleted from the blacklist. The blacklisted number to be added is verified against the target blacklist database. If it is determined that the blacklisted number to be added is not recorded in the target blacklist database, the network identification number in the blacklisted number to be added is used as the first key in the first hash structure, and the area code in the blacklisted number to be added is used as the first retrieval value pointed to by the corresponding key. In the second hash structure, the area code in the blacklisted number to be added is used as the second key, and the memory address of the storage bitmap of the last digit in the blacklisted number to be added is used as the second retrieval value pointed to by the key. The bit in the bitmap where the last digit in the blacklisted number to be added is determined according to the last digit in the blacklisted number to be added, and the bit is set from 0 to 1. The blacklist marker number to be deleted is queried based on the target blacklist database to determine the bit in the bitmap corresponding to the blacklist marker number to be deleted. The bit in the bitmap is changed from 1 to 0. At the same time, it is checked whether the data in the tail number storage bitmap corresponding to the blacklist marker number to be deleted are all 0. If it is determined that they are all 0, the area code corresponding to the blacklist marker number to be deleted in the first hash structure and the area code corresponding to the blacklist marker number to be deleted in the second hash structure are deleted. The tail number storage bitmap corresponding to the blacklist marker number to be deleted in the second hash structure is also deleted. Complete the update of the target blacklist database.

6. The blacklist number verification method based on bitmap structure according to claim 1, characterized in that, Based on the inspection information, the inspection time evaluation value corresponding to the network identification number to be optimized is determined, including: Obtain the number of checks for the network identification number to be optimized within the corresponding historical time period in the target blacklist database, as well as the check time for each last digit of the network identification number to be optimized. Based on the number of checks corresponding to the network identification number to be optimized within the corresponding historical time period in the target blacklist database and the check time of each last digit in the network identification number to be optimized, the check time evaluation value corresponding to the network identification number to be optimized is determined based on formula (1). (1) in, This represents the evaluation value of the verification time for the i-th network identifier within a historical time period t in the target blacklist database. This represents the number of times the j-th region code in the i-th network identifier has been tested within the historical time period t; Let represent the verification time of the last digit of the j-th region code within the historical time period t; n represents the total number of last digits in the j-th region code; m represents the total number of region codes in the i-th network identifier; n! represents the factorial of n, and (ni)! represents the factorial of ni.

7. The blacklist number verification method based on bitmap structure according to claim 6, characterized in that, The determination of the inspection impact value corresponding to the network identification number to be optimized based on the number of network identification numbers to be optimized, the estimated inspection time, the actual inspection time, and the actual number of inspections in the inspection information includes: Based on formula (2), determine the test impact value corresponding to the network identification number to be optimized; (2) Z represents the test impact value; m represents the total number of region codes in the i-th network identifier; This indicates the number of network identifiers to be optimized. This represents the actual number of tests corresponding to the j-th historical region code in the current network identification number. This indicates the estimated verification time corresponding to the current network identification number. This represents the actual verification time corresponding to the j-th historical region code of the current network identification number. This represents the verification time of the a-th digit of the current network identifier in the j-th region code within the historical time period t, where n represents the total number of digits in the j-th region code.

8. The blacklist number verification method based on bitmap structure according to claim 7, characterized in that, The determination of the target inspection order value for the network identification number to be optimized, based on the inspection time evaluation value and inspection impact value corresponding to the network identification number to be optimized, includes: Based on the evaluation value of the inspection time and the inspection impact value corresponding to the network identification number to be optimized, the target inspection order value of the network identification number to be optimized is determined according to formula (3); (3) in, This represents the target verification order value of the network identifier at time t; Z represents the evaluation value of the inspection time of the i-th network identifier to be inspected within the historical time period t in the target blacklist database; Z represents the inspection impact value; and n represents the total number of tail numbers in the j-th region code.

Citation Information

Patent Citations

  • Blacklist query method and system, electronic equipment and storage medium

    CN113986921A