Number interception method and device, electronic equipment and storage medium

By converting the number into a sub-object and utilizing bitmap data storage and retrieval, the problem of low efficiency in number blocking is solved, achieving highly efficient number blocking.

CN119172471BActive Publication Date: 2026-05-19CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2024-08-21
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing number blocking methods suffer from low efficiency in the matching and authentication process due to the large number of reference numbers, resulting in low number blocking efficiency.

Method used

The reference number is converted into N reference sub-objects and mapped and stored in the bitmap data. The target number is converted into N target sub-objects and then checked in the bitmap data to see if it exists. The decision to intercept is based on the query result.

Benefits of technology

By using bitmap data storage and retrieval, storage space is saved and retrieval speed is improved, number blocking efficiency is increased, and device performance is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172471B_ABST
    Figure CN119172471B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a number interception method and device, electronic equipment and storage medium. The number interception method comprises: converting a reference number into N reference sub-objects according to a target conversion mode in advance, and storing the reference sub-objects into bitmap data for each reference sub-object, N being a positive integer; after obtaining a target number, converting the target number into N target sub-objects according to the target conversion mode, and querying whether the target sub-objects exist in the bitmap data for each target sub-object to obtain a query result of the target sub-objects; and judging whether the target number needs to be intercepted according to the query result of the N target sub-objects, and if so, intercepting the target number. In the embodiments of the present application, compared with storing the entire reference number, the bitmap data storage method can save a large amount of storage space, and the bitmap data query operation is faster, thereby improving the efficiency of number interception.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a number interception method, apparatus, electronic device, and storage medium. Background Technology

[0002] Number blocking is an important feature offered by smartphones and telecommunications operators, designed to help users reduce unwanted nuisance and scam calls.

[0003] Current number blocking methods typically involve persistently storing a large number of reference numbers (such as numbers to be blocked) locally, or using a database or FTP (File Transfer Protocol) file server. When a call number is obtained, the system checks the stored reference numbers to see if the number exists, and then blocks the call based on the query result. However, the sheer number of reference numbers leads to inefficient matching and authentication processes, resulting in low overall number blocking efficiency. Summary of the Invention

[0004] In view of the above problems, this application proposes a number blocking method, apparatus, electronic device and storage medium to improve the efficiency of number blocking.

[0005] According to one aspect of an embodiment of this application, a number blocking method is provided, the method comprising:

[0006] The reference number is pre-converted into N reference sub-objects according to the target conversion method, and for each reference sub-object, the reference sub-object is mapped and stored in bitmap data, where N is a positive integer;

[0007] After obtaining the target number, the target number is converted into N target sub-objects according to the target conversion method. For each target sub-object, the existence of the target sub-object is queried from the bitmap data to obtain the query result of the target sub-object.

[0008] Based on the query results of the N target sub-objects, determine whether the target number needs to be intercepted; if so, intercept the target number.

[0009] Optionally, the step of converting the reference number into N reference sub-objects in advance according to the target conversion method includes: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and determining the first reference sub-object and the second reference sub-object as the N reference sub-objects;

[0010] The step of converting the target number into N target sub-objects according to the target conversion method includes: performing the first calculation on the target number to obtain a first target sub-object, performing the second calculation on the target number to obtain a second target sub-object, and determining the first target sub-object and the second target sub-object as the N target sub-objects.

[0011] Optionally, the step of converting the reference number into N reference sub-objects in advance according to the target conversion method includes: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and performing a third calculation on the reference number to obtain a third reference sub-object; and determining the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects.

[0012] The step of converting the target number into N target sub-objects according to the target conversion method includes: performing the first calculation on the target number to obtain a first target sub-object, performing the second calculation on the target number to obtain a second target sub-object, and performing the third calculation on the target number to obtain a third target sub-object; and determining the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects.

[0013] Optionally, the step of performing a first calculation on the reference number to obtain a first reference sub-object includes:

[0014] Divide the reference number by a set value to obtain a reference quotient, and use the integer part of the reference quotient as the first reference sub-object;

[0015] The set value is 10. n , where n is a positive integer with fewer digits than the reference number.

[0016] Optionally, the step of performing a second calculation on the reference number to obtain a second reference sub-object includes:

[0017] The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is bitwise ANDed with the mask binary number with the set number of bits to obtain a first binary number. The decimal number corresponding to the first binary number is used as the second reference sub-object.

[0018] Wherein, the first m bits of the mask binary number are 0 and the last m bits are 1, where m is half of the set number of bits.

[0019] Optionally, the step of performing a third calculation on the reference number to obtain a third reference sub-object includes:

[0020] The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is right-shifted by m bits to obtain a second binary number. The decimal number corresponding to the second binary number is used as the third reference sub-object.

[0021] Where m is half of the set number of bits.

[0022] Optionally, the initial value of each bit in the bitmap data is a first value representing non-existence; the step of mapping and storing the reference sub-object into the bitmap data includes:

[0023] The reference sub-object is used as the reference position index of the reference sub-object in the bitmap data, and the value of the corresponding bit in the bitmap data is set to a second value indicating its existence.

[0024] Optionally, the step of querying the bitmap data to determine whether the target sub-object exists, and obtaining the query result of the target sub-object, includes:

[0025] The target sub-object is used as the target position index of the target sub-object in the bitmap data, and the value of the corresponding bit of the target position index in the bitmap data is used as the query result of the target sub-object.

[0026] Optionally, the bitmap data consists of N elements;

[0027] The step of mapping and storing the reference sub-object into bitmap data includes: mapping and storing the reference sub-object into the bitmap data corresponding to the reference sub-object;

[0028] The step of querying whether the target sub-object exists in the bitmap data and obtaining the query result of the target sub-object includes: querying whether the target sub-object exists in the bitmap data corresponding to the target sub-object and obtaining the query result of the target sub-object.

[0029] Optionally, determining whether to intercept the target number based on the query results of the N target sub-objects includes:

[0030] When the reference number is a number that needs to be intercepted, if the query results of all N target sub-objects exist, then it is determined that the target number needs to be intercepted.

[0031] When the reference number is a number that does not need to be intercepted, if at least one of the query results of the N target sub-objects does not exist, then it is determined that the target number needs to be intercepted.

[0032] Optionally, the reference number is a mobile phone number; before converting the target number into multiple target sub-objects according to the target conversion method after obtaining the target number, the method further includes:

[0033] After obtaining the user's number in the call request, if the user's number is determined to be a mobile phone number, then the user's number is used as the target number.

[0034] According to another aspect of the embodiments of this application, a number blocking device is provided, the device comprising:

[0035] The mapping module is used to pre-convert the reference number into N reference sub-objects according to the target conversion method, and for each reference sub-object, map and store the reference sub-object into bitmap data, where N is a positive integer;

[0036] The query module is used to convert the target number into N target sub-objects according to the target conversion method after obtaining the target number, and for each target sub-object, query the bitmap data to see if the target sub-object exists, and obtain the query result of the target sub-object;

[0037] The judgment module is used to determine whether the target number needs to be intercepted based on the query results of the N target sub-objects. If so, the target number is intercepted.

[0038] Optionally, the mapping module is specifically used to perform a first calculation on the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and determine the first reference sub-object and the second reference sub-object as the N reference sub-objects;

[0039] The query module is specifically used to perform the first calculation on the target number to obtain a first target sub-object, and to perform the second calculation on the target number to obtain a second target sub-object; and to determine the first target sub-object and the second target sub-object as the N target sub-objects.

[0040] Optionally, the mapping module is specifically used to pre-calculate the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and perform a third calculation on the reference number to obtain a third reference sub-object; and determine the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects;

[0041] The query module is specifically used to perform the first calculation on the target number to obtain a first target sub-object, perform the second calculation on the target number to obtain a second target sub-object, and perform the third calculation on the target number to obtain a third target sub-object; and determine the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects.

[0042] Optionally, the mapping module includes:

[0043] The first conversion unit is used to divide the reference number by a set value to obtain a reference quotient value, and to use the integer part of the reference quotient value as the first reference sub-object.

[0044] The set value is 10. n , where n is a positive integer with fewer digits than the reference number.

[0045] Optionally, the mapping module includes:

[0046] The second conversion unit is used to convert the reference number into a reference binary number with a set number of bits, and to perform a bitwise AND operation between the reference binary number and the mask binary number with the set number of bits to obtain a first binary number, and to use the decimal number corresponding to the first binary number as the second reference sub-object.

[0047] Wherein, the first m bits of the mask binary number are 0 and the last m bits are 1, where m is half of the set number of bits.

[0048] Optionally, the mapping module includes:

[0049] The third conversion unit is used to convert the reference number into a reference binary number with a set number of bits, and to right-shift the reference binary number by m bits to obtain a second binary number, and to use the decimal number corresponding to the second binary number as the third reference sub-object;

[0050] Where m is half of the set number of bits.

[0051] Optionally, the initial value of each bit in the bitmap data is a first value indicating non-existence; the mapping module includes: a value setting unit, used to use the reference sub-object as the reference position index of the reference sub-object in the bitmap data, and to set the value of the bit corresponding to the reference position index in the bitmap data to a second value indicating existence.

[0052] Optionally, the query module includes: a numerical query unit, used to use the target sub-object as the target position index of the target sub-object in the bitmap data, and use the value of the corresponding bit of the target position index in the bitmap data as the query result of the target sub-object.

[0053] Optionally, the bitmap data consists of N elements;

[0054] The mapping module is specifically used to map and store the reference sub-object into the bitmap data corresponding to the reference sub-object;

[0055] The query module is specifically used to query whether the target sub-object exists in the bitmap data corresponding to the target sub-object, and obtain the query result of the target sub-object.

[0056] Optionally, the determination module includes:

[0057] The first determining unit is configured to determine that the target number needs to be intercepted if the query results of all N target sub-objects exist when the reference number is a number to be intercepted.

[0058] The second determining unit is configured to determine that the target number needs to be intercepted if at least one of the query results of the N target sub-objects does not exist when the reference number is a number that does not need to be intercepted.

[0059] Optionally, the reference number is a mobile phone number; the device further includes: a determining module, configured to, after obtaining the user number in the call request, determine that the user number is a mobile phone number, and then use the user number as the target number.

[0060] According to another aspect of the embodiments of this application, an electronic device is provided, the electronic device including a processor and a computer-readable storage medium storing a computer program thereon; when the computer program is executed by the processor, the processor causes the processor to perform the number blocking method as described in any of the preceding claims.

[0061] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, causes the processor to perform the number blocking method as described in any of the preceding claims.

[0062] In this embodiment, a bitmap data mapping is used to store the reference sub-objects converted from the reference number. A query is performed based on the bitmap data to determine if a target sub-object converted from the target number exists. The query result for the target sub-object is then used to determine whether the target number needs to be intercepted. If so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, compared to storing the entire reference number, using bitmap data storage can save a significant amount of storage space. Furthermore, the query operation of bitmap data involves simple read operations on the bits, resulting in faster query speeds. This improves the efficiency of number interception and enhances the performance of the number interception device.

[0063] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0064] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some drawings of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0065] Figure 1 This is a flowchart illustrating the steps of a number blocking method according to an embodiment of this application;

[0066] Figure 2 This is a schematic diagram of bitmap data according to an embodiment of this application;

[0067] Figure 3 This is a flowchart of a number blocking method according to an embodiment of this application;

[0068] Figure 4 This is a structural block diagram of a number blocking device according to an embodiment of this application;

[0069] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application;

[0070] Figure 6 This is a structural block diagram of a computer-readable storage medium according to an embodiment of this application. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0072] Reference Figure 1 The diagram illustrates a flowchart of a number blocking method according to an embodiment of this application.

[0073] like Figure 1 As shown, the number blocking method may include the following steps:

[0074] Step 101: Convert the reference number into N reference sub-objects in advance according to the target conversion method, and for each reference sub-object, map and store the reference sub-object into bitmap data.

[0075] In this embodiment of the application, the reference number refers to the number that needs to be saved as the basis for number interception.

[0076] For example, the reference number can be a number that needs to be blocked, or a number that does not need to be blocked. For example, the number that needs to be blocked can be a scam phone number, a telemarketing phone number, a harassing phone number, and so on. For example, the number that does not need to be blocked can be other phone numbers besides the numbers mentioned above that need to be blocked, and so on.

[0077] In this embodiment, the reference sub-object refers to a sub-object obtained by converting a reference number. The reference sub-object can be a value calculated from the reference number, or it can be a portion of the extracted reference number.

[0078] The specific value of N can be set according to actual needs, and this embodiment does not impose any restrictions on it. For example, N can be set to 2, 3, etc.

[0079] In one optional implementation, the process of converting a reference number into N reference sub-objects in advance according to the target conversion method may include: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and determining the first reference sub-object and the second reference sub-object as the N reference sub-objects.

[0080] For example, the process of performing a first calculation on the reference number to obtain a first reference sub-object may include: dividing the reference number by a preset value to obtain a reference quotient, and using the integer part of the reference quotient as the first reference sub-object. Wherein, the preset value is 10. n n is a positive integer less than the number of digits (total number of digits) of the reference number.

[0081] In this method, the first reference sub-object is specifically the first L digits of the reference number, where L is the difference between the number of digits in the reference number and n.

[0082] For example, for a reference number that is 11 digits long, the value is set to 10. 7 That is, 10000000, then the first reference sub-object obtained after calculation is the first 4 digits of the reference number.

[0083] The specific value of n can be set according to actual needs, and this embodiment does not impose any restrictions on it.

[0084] For example, the process of performing a second calculation on the reference number to obtain a second reference sub-object may include: converting the reference number into a reference binary number of a set number of bits, performing a bitwise AND operation between the reference binary number and the mask binary number of the set number of bits to obtain a first binary number, and using the decimal number corresponding to the first binary number as the second reference sub-object. Wherein, the first m bits of the mask binary number are 0, the last m bits are 1, and m is half of the set number of bits.

[0085] In the process of converting the reference number into a reference binary number with a set number of bits, the reference number can first be converted into a binary number, which is called the initial reference binary number. If the number of bits in the initial reference binary number is less than the set number of bits, zeros are padded in front of the first digit of the initial reference binary number until the sum of the number of zeros padded and the number of bits in the initial reference binary number reaches the set number of bits. The resulting binary number is the reference binary number with the set number of bits.

[0086] The reference number is a decimal number. For the process of converting a decimal number to a binary number, any applicable method can be selected based on practical experience.

[0087] For example, decimal numbers can be converted to binary numbers using methods such as "dividing by 2 and taking the remainder" or "program calculation".

[0088] For example, the process of the "divide by 2 and take the remainder method" is as follows:

[0089] (1) Divide a decimal number by 2: First, divide the decimal number to be converted by 2.

[0090] (2) Record the remainder: After each division operation, record the remainder (0 or 1). This remainder is one bit in the binary number.

[0091] (3) Repeat steps (1) and (2) for the quotient: divide the quotient obtained in the previous step by 2 again and record the remainder. Repeat this process until the quotient is 0.

[0092] (4) Reverse the order of remainders: Arrange all the recorded remainders in reverse order (i.e., place the first remainder in the least significant bit and the last remainder in the most significant bit). The resulting number is the binary representation of the original decimal number.

[0093] In the process of performing a bitwise AND operation between the reference binary number and the mask binary number of a set number of bits, the bitwise AND operation refers to performing a logical AND operation between each bit of the reference binary number and the corresponding bit of the mask binary number. If the value of the bit being ANDed is 1 in both the reference binary number and the mask binary number, the result of the bitwise AND operation is 1; otherwise, the result of the bitwise AND operation is 0. The i-th bit in the reference binary number corresponds to the i-th bit in the mask binary number.

[0094] The specific value of the number of bits can be set according to actual needs, and this embodiment does not impose any restrictions on it. The number of bits can be an even number, specifically a power of 2, such as 64 bits, 128 bits, etc.

[0095] For example, if the set bit length is 64 bits, and the initial reference binary number obtained from the reference number has 34 bits, then 30 zeros are added before the first digit of the initial reference binary number to obtain a 64-bit reference binary number. The first 32 bits of the mask binary number are all 0s, and the last 32 bits are all 1s. A bitwise AND operation is performed between the 64-bit reference binary number and the 64-bit mask binary number. The resulting first binary number has the first 32 bits all 0s, and the last 32 bits are the last 32 bits of the reference binary number.

[0096] After obtaining the first binary number, since the first binary number is a binary number, it is then converted into a decimal number, and the decimal number corresponding to the first binary number is used as the second reference sub-object.

[0097] For the process of converting binary numbers to decimal numbers, any applicable method can be selected based on practical experience.

[0098] For example, you can iterate through each bit of the binary number from right to left, multiply it by the corresponding power of 2 (starting from 0), and then add it to the result.

[0099] Suppose we have a binary number b n b n-1 ...b1b0, where b n b0 is the most significant bit (leftmost bit), and b0 is the least significant bit (rightmost bit). Multiply the rightmost bit (b0) by 2. 0 The next bit (b1) is multiplied by 2 1 And so on, until the highest bit (b) n Multiply by 2 n Finally, by adding all the products together, you can obtain the decimal number corresponding to the binary number.

[0100] In one optional implementation, the process of converting a reference number into N reference sub-objects in advance according to the target conversion method may include: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and performing a third calculation on the reference number to obtain a third reference sub-object; and determining the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects.

[0101] For example, the process of performing a third calculation on the reference number to obtain a third reference sub-object may include: converting the reference number into a reference binary number of a set number of bits, shifting the reference binary number right by m bits to obtain a second binary number, and using the decimal number corresponding to the second binary number as the third reference sub-object. Here, m is half of the set number of bits.

[0102] The process of converting the reference number into a reference binary number of a set number of bits can be referred to the relevant description above, and will not be discussed in detail here.

[0103] The process of right-shifting the reference binary number by m bits involves deleting the last m bits of the reference binary number and padding the first digit of the reference binary number with m zeros. Therefore, the second binary number obtained by right-shifting the reference binary number by m bits has the first m bits as 0s and the last m bits as the first m bits of the reference binary number.

[0104] For example, if the set bit length is 64 bits, and the initial reference binary number obtained from the reference number has 34 bits, then 30 zeros are added before the first digit of the initial reference binary number to obtain a 64-bit reference binary number. The 64-bit reference binary number is then right-shifted by 32 bits, resulting in a second binary number where the first 32 bits are all 0s, and the last 32 bits are the first 32 bits of the original reference binary number.

[0105] After obtaining the second binary number, since it is a binary number, it is then converted to a decimal number, and the corresponding decimal number is used as the third reference sub-object. The specific conversion process can be found in the description above, and will not be discussed in detail here.

[0106] After converting the reference number into N reference sub-objects, for each reference sub-object, the reference sub-object is mapped and stored in bitmap data.

[0107] Bitmap data is a data structure that represents a dense set in a finite field, where each element appears at least once and is not associated with any other data. Bitmap data is a compact data structure used to represent the state (presence or absence) of elements in a fixed-size set or sequence. It uses a bit array to represent the state of elements in the set, with each element corresponding to one bit, thus achieving high space and time performance.

[0108] In this embodiment of the application, bitmap data that can meet storage requirements is set. The bitmap data contains multiple bits, each bit having its own corresponding position index. The initial value of each bit in the bitmap data is a first value indicating non-existence.

[0109] For example, the process of mapping and storing the reference sub-object in bitmap data may include: using the reference sub-object as a reference position index in the bitmap data, and setting the value of the bit corresponding to the reference position index in the bitmap data to a second value indicating its existence. It should be noted that the reference position index is the position index corresponding to the bit in the bitmap data; in this embodiment, it is referred to as the reference position index for ease of distinction.

[0110] For example, if the reference sub-object is 1561, then the bit in the bitmap data with position index 1561 is set to a second value indicating its existence.

[0111] The specific forms of the first and second values ​​can be set according to actual needs, and this embodiment does not impose any restrictions on them. For example, the first value can be set to 0, the second value to 1, and so on.

[0112] Step 102: After obtaining the target number, the target number is converted into N target sub-objects according to the target conversion method. For each target sub-object, the existence of the target sub-object is queried from the bitmap data to obtain the query result of the target sub-object.

[0113] In this embodiment, call requests are monitored. Upon detection, the call request can be temporarily blocked, and the target number can be obtained from the call request. The target number refers to the number from which it needs to be determined whether to block it.

[0114] In this embodiment, a target sub-object refers to a sub-object derived from a target number. The target sub-object can be a calculated value derived from the target number, or it can be a portion of the extracted target number. The number of target sub-objects derived from a target number is the same as the number of reference sub-objects derived from a reference number.

[0115] In one optional implementation, the process of converting the target number into N target sub-objects according to the target conversion method may include: performing the first calculation on the target number to obtain a first target sub-object, performing the second calculation on the target number to obtain a second target sub-object, and determining the first target sub-object and the second target sub-object as the N target sub-objects. The first calculation is the same as the first calculation in the process of performing the first calculation on the reference number described above, and the second calculation is the same as the second calculation in the process of performing the second calculation on the reference number described above.

[0116] In one optional implementation, the process of converting the target number into N target sub-objects according to the target conversion method may include: performing a first calculation on the target number to obtain a first target sub-object, performing a second calculation on the target number to obtain a second target sub-object, and performing the third calculation on the target number to obtain a third target sub-object; and determining the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects. Wherein, the first calculation is the same as the first calculation in the process of performing a first calculation on the reference number, the second calculation is the same as the second calculation in the process of performing a second calculation on the reference number, and the third calculation is the same as the second calculation in the process of performing a third calculation on the reference number.

[0117] For example, the process of performing a first calculation on the target number to obtain a first target sub-object may include: dividing the target number by the preset value to obtain a target quotient, and using the integer part of the target quotient as the first target sub-object. The preset value is the same as the preset value used in the process of performing a first calculation on the reference number to obtain a first reference sub-object described above.

[0118] For example, the process of performing a second calculation on the target number to obtain a second target sub-object may include: converting the target number into a target binary number of a set number of bits, performing a bitwise AND operation between the target binary number and a mask binary number of the set number of bits to obtain a third binary number, and using the decimal number corresponding to the third binary number as the second target sub-object. Wherein, the set number of bits is the same as the set number of bits used in the process of performing a second calculation on the reference number to obtain a second reference sub-object, the first m bits of the mask binary number are 0, the last m bits are 1, and m is half of the set number of bits.

[0119] For example, the process of performing a third calculation on the target number to obtain a third target sub-object may include: converting the target number into a target binary number of a set number of bits, shifting the target binary number right by m bits to obtain a fourth binary number, and using the decimal number corresponding to the fourth binary number as the third target sub-object. Here, the set number of bits is the same as the set number of bits used in the process of performing a third calculation on the reference number to obtain a third reference sub-object, and m is half of the set number of bits.

[0120] After converting the target number into N target sub-objects, for each target sub-object, query the bitmap data to see if the target sub-object exists, and obtain the query result of the target sub-object.

[0121] For example, the process of querying whether the target sub-object exists in the bitmap data and obtaining the query result of the target sub-object may include: using the target sub-object as the target position index of the target sub-object in the bitmap data, and using the value of the corresponding bit of the target position index in the bitmap data as the query result of the target sub-object.

[0122] The query result for the target sub-object indicates whether the target sub-object exists in the bitmap data. When the query result for the target sub-object is a first value indicating non-existence (e.g., 0), it means that the target sub-object does not exist in the bitmap data; when the query result for the target sub-object is a second value indicating existence (e.g., 1), it means that the target sub-object exists in the bitmap data.

[0123] For example, if the target sub-object is 1561, then the value of the bit with position index 1561 in the bitmap data will be used as the query result of the target sub-object.

[0124] In one optional implementation, the number of bitmap data can be N, that is, the number of bitmap data is the same as the number of reference sub-objects converted from a reference number, and each reference sub-object converted from a reference number corresponds to one bitmap data. At the same time, the number of bitmap data is the same as the number of target sub-objects converted from a target number, and each target sub-object converted from a target number corresponds to one bitmap data.

[0125] For example, the process of mapping and storing the reference sub-object into bitmap data may include: mapping and storing the reference sub-object into the bitmap data corresponding to the reference sub-object.

[0126] For example, the process of querying whether the target sub-object exists in the bitmap data and obtaining the query result of the target sub-object may include: querying whether the target sub-object exists in the bitmap data corresponding to the target sub-object and obtaining the query result of the target sub-object.

[0127] Reference Figure 2 This diagram illustrates a bitmap data according to an embodiment of this application. Figure 2 As shown, it contains bitmap data 1, bitmap data 2, and bitmap data 3. Each bit in each bitmap data has its own position index (e.g., ...). Figure 2 The reference number is represented by 00000001, 00000002, 00000003, etc., where each bit has a value of 0 (indicating non-existence) or 1 (indicating presence). After converting the reference number into three sub-objects, each sub-object is mapped and stored in its corresponding bitmap data. After converting the target number into three target sub-objects, the existence of the target sub-object is checked in the bitmap data corresponding to each sub-object.

[0128] For the specific mapping, storage, and query process, please refer to the relevant description above. This embodiment will not elaborate further here.

[0129] By setting up multiple bitmap data sets and storing different types of reference sub-objects separately, the amount of data in each bitmap data set can be reduced, thereby improving the efficiency of mapping storage and querying.

[0130] In one optional implementation, the reference number can be a mobile phone number. Accordingly, before the step of converting the target number into multiple target sub-objects according to the target conversion method after obtaining the target number, the method may further include: after obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, then the user number is used as the target number; if it is determined that the user number is not a mobile phone number, then the user number is not used as the target number. Therefore, the process of converting the target number into multiple target sub-objects according to the target conversion method after obtaining the target number is not executed, and thus the user number in the call request can be avoided.

[0131] The specific process for determining whether a user's number is a mobile phone number can be handled using any applicable method based on practical experience; this embodiment does not impose any restrictions on this. For example, the characteristics of a mobile phone number, such as the number of digits or the fact that each digit is a number, can be used to determine whether the user's number matches the characteristics of a mobile phone number. If it does, the user's number is determined to be a mobile phone number; otherwise, it is determined not to be a mobile phone number.

[0132] Step 103: Based on the query results of the N target sub-objects, determine whether the target number needs to be intercepted. If so, intercept the target number.

[0133] In one optional implementation, the process of determining whether to intercept the target number based on the query results of the N target sub-objects may include: when the reference number is a number that needs to be intercepted, if all the query results of the N target sub-objects exist, then it is determined that the target number needs to be intercepted; when the reference number is a number that does not need to be intercepted, if at least one of the query results of the N target sub-objects does not exist, then it is determined that the target number needs to be intercepted.

[0134] Specifically, if all N target sub-objects have a query result indicating that they exist, it means that the target number exists in the bitmap data; if at least one of the N target sub-objects has a query result indicating that they do not exist, it means that the target number does not exist in the bitmap data.

[0135] For example, the first value representing non-existence is set to 0, and the first value representing existence is set to 1. The target number is converted into a first target sub-object, a second target sub-object, and a third target sub-object. If the query results of the first target sub-object, the second target sub-object, and the third target sub-object are all 1, then it can be considered that the target number exists in the bitmap data; otherwise, it is considered that the target number does not exist in the bitmap data.

[0136] If it is determined that the target number needs to be blocked, then the target number can be blocked, and the specific blocking method can be handled based on practical experience. If it is determined that the target number does not need to be blocked, then the target number is not blocked, and the call request is forwarded to the next destination (such as forwarding it to the called user, etc.).

[0137] In this embodiment, a bitmap data mapping is used to store reference sub-objects converted from reference numbers. A query is performed based on the bitmap data to determine if a target sub-object converted from a target number exists. The query result for the target sub-object is then used to determine whether the target number needs to be intercepted; if so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, this method saves a significant amount of storage space compared to storing the entire reference number. Furthermore, the query operation in bitmap data involves simple read operations on individual bits, resulting in faster query speeds. This improves the efficiency of number interception and enhances the performance of the number interception device.

[0138] Reference Figure 3 The diagram shows a flowchart of a number interception method according to an embodiment of this application.

[0139] like Figure 3 As shown, number blocking methods may include:

[0140] The reference number (specifically a mobile phone number) is transformed to obtain N reference sub-objects, and bitmap data is generated based on the reference sub-objects. This process corresponds to step 101 above.

[0141] Access authentication is performed to obtain the user's number from the call request.

[0142] Determine if the user's number is a mobile phone number. If yes, proceed to the next step; otherwise, authentication fails.

[0143] The user's number is used as the target number, and the target number is transformed to obtain N target sub-objects.

[0144] Match N target sub-objects with bitmap data.

[0145] Determine if all N target sub-objects exist in the bitmap data. If yes, authentication passes; otherwise, authentication fails.

[0146] Successful authentication indicates that the target number exists in the bitmap data, while unsuccessful authentication indicates that the target number does not exist in the bitmap data.

[0147] In this embodiment of the application, by converting the number into multiple sub-objects for processing, the application scenarios are more extensive and are not limited by the number of digits.

[0148] Reference Figure 4 The diagram shows a structural block diagram of a number blocking device according to an embodiment of this application.

[0149] like Figure 4 As shown, a number blocking device may include the following modules:

[0150] The mapping module 401 is used to pre-convert the reference number into N reference sub-objects according to the target conversion method, and for each reference sub-object, map and store the reference sub-object into bitmap data, where N is a positive integer;

[0151] The query module 402 is used to, after obtaining the target number, convert the target number into N target sub-objects according to the target conversion method, and for each target sub-object, query from the bitmap data whether the target sub-object exists, and obtain the query result of the target sub-object;

[0152] The judgment module 403 is used to determine whether the target number needs to be intercepted based on the query results of the N target sub-objects. If so, the target number is intercepted.

[0153] Optionally, the mapping module 401 is specifically used to perform a first calculation on the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and determine the first reference sub-object and the second reference sub-object as the N reference sub-objects;

[0154] The query module 402 is specifically used to perform the first calculation on the target number to obtain a first target sub-object, perform the second calculation on the target number to obtain a second target sub-object, and determine the first target sub-object and the second target sub-object as the N target sub-objects.

[0155] Optionally, the mapping module 401 is specifically used to perform a first calculation on the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and perform a third calculation on the reference number to obtain a third reference sub-object; and determine the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects;

[0156] The query module 402 is specifically used to perform the first calculation on the target number to obtain a first target sub-object, perform the second calculation on the target number to obtain a second target sub-object, and perform the third calculation on the target number to obtain a third target sub-object; and determine the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects.

[0157] Optionally, the mapping module 401 includes:

[0158] The first conversion unit is used to divide the reference number by a set value to obtain a reference quotient value, and to use the integer part of the reference quotient value as the first reference sub-object.

[0159] The set value is 10. n , where n is a positive integer with fewer digits than the reference number.

[0160] Optionally, the mapping module 401 includes:

[0161] The second conversion unit is used to convert the reference number into a reference binary number with a set number of bits, and to perform a bitwise AND operation between the reference binary number and the mask binary number with the set number of bits to obtain a first binary number, and to use the decimal number corresponding to the first binary number as the second reference sub-object.

[0162] Wherein, the first m bits of the mask binary number are 0 and the last m bits are 1, where m is half of the set number of bits.

[0163] Optionally, the mapping module 401 includes:

[0164] The third conversion unit is used to convert the reference number into a reference binary number with a set number of bits, and to right-shift the reference binary number by m bits to obtain a second binary number, and to use the decimal number corresponding to the second binary number as the third reference sub-object;

[0165] Where m is half of the set number of bits.

[0166] Optionally, the initial value of each bit in the bitmap data is a first value indicating non-existence; the mapping module 401 includes: a value setting unit, used to use the reference sub-object as the reference position index of the reference sub-object in the bitmap data, and set the value of the bit corresponding to the reference position index in the bitmap data to a second value indicating existence.

[0167] Optionally, the query module 402 includes: a numerical query unit, used to use the target sub-object as the target position index of the target sub-object in the bitmap data, and use the value of the corresponding bit of the target position index in the bitmap data as the query result of the target sub-object.

[0168] Optionally, the bitmap data consists of N elements;

[0169] The mapping module 401 is specifically used to map and store the reference sub-object into the bitmap data corresponding to the reference sub-object.

[0170] The query module 402 is specifically used to query whether the target sub-object exists in the bitmap data corresponding to the target sub-object, and obtain the query result of the target sub-object.

[0171] Optionally, the determination module 403 includes:

[0172] The first determining unit is configured to determine that the target number needs to be intercepted if the query results of all N target sub-objects exist when the reference number is a number to be intercepted.

[0173] The second determining unit is configured to determine that the target number needs to be intercepted if at least one of the query results of the N target sub-objects does not exist when the reference number is a number that does not need to be intercepted.

[0174] Optionally, the reference number is a mobile phone number; the device further includes: a determining module, configured to, after obtaining the user number in the call request, determine that the user number is a mobile phone number, and then use the user number as the target number.

[0175] In this embodiment, a bitmap data mapping is used to store reference sub-objects converted from reference numbers. A query is performed based on the bitmap data to determine if a target sub-object converted from a target number exists. The query result for the target sub-object is then used to determine whether the target number needs to be intercepted; if so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, this method saves a significant amount of storage space compared to storing the entire reference number. Furthermore, the query operation in bitmap data involves simple read operations on individual bits, resulting in faster query speeds. This improves the efficiency of number interception and enhances the performance of the number interception device.

[0176] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0177] In embodiments of this application, an electronic device is also provided. This electronic device may include a processor and a computer-readable storage medium storing a computer program; when the computer program is executed by the processor, it causes the processor to perform the number blocking method of any of the above embodiments.

[0178] Reference Figure 5 This diagram illustrates a structural block diagram of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device 50 includes a processor 501 and a computer-readable storage medium 502, on which a computer program 5021 is stored.

[0179] The processor 501 is used to execute the computer program 5021 stored on the computer-readable storage medium 502. When the processor 501 executes the computer program 5021, it implements the number interception method of any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0180] The processor 501 mentioned above may include, but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0181] The computer-readable storage medium 502 mentioned above may include, but is not limited to: read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), electronically erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.

[0182] In embodiments of this application, a computer-readable storage medium is also provided, on which a computer program is stored, which can be executed by a processor of an electronic device, and when the computer program is executed by the processor, the processor performs the number blocking method as described in any of the above embodiments.

[0183] Reference Figure 5 This diagram illustrates a structural block diagram of a computer-readable storage medium according to an embodiment of this application. Figure 5 As shown, a computer-readable storage medium 50 stores a computer program 501. When the computer program 501 is executed by a processor, it causes the processor to perform the number interception method as described in any of the above embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0184] The various embodiments in this specification are related to each other and are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other.

[0185] It should be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.

[0186] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0187] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0188] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0190] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0191] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0193] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0194] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. In summary, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for blocking phone numbers, characterized in that, The method includes: The reference number is pre-converted into N reference sub-objects according to the target conversion method, and for each reference sub-object, the reference sub-object is mapped and stored in bitmap data, where N is a positive integer; After obtaining the target number, the target number is converted into N target sub-objects according to the target conversion method. For each target sub-object, the existence of the target sub-object is queried from the bitmap data to obtain the query result of the target sub-object. Based on the query results of the N target sub-objects, determine whether the target number needs to be intercepted; if so, intercept the target number. The step of converting a reference number into N reference sub-objects according to a target conversion method includes: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and determining the first reference sub-object and the second reference sub-object as the N reference sub-objects; The step of converting the target number into N target sub-objects according to the target conversion method includes: performing the first calculation on the target number to obtain a first target sub-object, performing the second calculation on the target number to obtain a second target sub-object; and determining the first target sub-object and the second target sub-object as the N target sub-objects. The step of converting a reference number into N reference sub-objects according to a target conversion method further includes: performing a first calculation on the reference number to obtain a first reference sub-object, performing a second calculation on the reference number to obtain a second reference sub-object, and performing a third calculation on the reference number to obtain a third reference sub-object; and determining the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects. The step of converting the target number into N target sub-objects according to the target conversion method further includes: performing the first calculation on the target number to obtain a first target sub-object, performing the second calculation on the target number to obtain a second target sub-object, and performing the third calculation on the target number to obtain a third target sub-object; and determining the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects. The step of performing a first calculation on the reference number to obtain a first reference sub-object includes: Divide the reference number by a set value to obtain a reference quotient, and use the integer part of the reference quotient as the first reference sub-object; Wherein, the set value is n, which is a positive integer with fewer digits than the reference number; The step of performing a second calculation on the reference number to obtain a second reference sub-object includes: The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is bitwise ANDed with the mask binary number with the set number of bits to obtain a first binary number. The decimal number corresponding to the first binary number is used as the second reference sub-object. Wherein, the first m bits of the mask binary number are 0, the last m bits are 1, and m is half of the set number of bits; The third calculation of the reference number to obtain the third reference sub-object includes: The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is right-shifted by m bits to obtain a second binary number. The decimal number corresponding to the second binary number is used as the third reference sub-object; where m is half of the set number of bits.

2. The method according to claim 1, characterized in that, The initial value of each bit in the bitmap data is a first value representing non-existence; the step of mapping and storing the reference sub-object into the bitmap data includes: The reference sub-object is used as the reference position index of the reference sub-object in the bitmap data, and the value of the corresponding bit in the bitmap data is set to a second value indicating its existence.

3. The method according to claim 2, characterized in that, The step of querying whether the target sub-object exists in the bitmap data and obtaining the query result of the target sub-object includes: The target sub-object is used as the target position index of the target sub-object in the bitmap data, and the value of the corresponding bit of the target position index in the bitmap data is used as the query result of the target sub-object.

4. The method according to claim 1, characterized in that, The bitmap data consists of N elements; The step of mapping and storing the reference sub-object into bitmap data includes: mapping and storing the reference sub-object into the bitmap data corresponding to the reference sub-object; The step of querying whether the target sub-object exists in the bitmap data and obtaining the query result of the target sub-object includes: querying whether the target sub-object exists in the bitmap data corresponding to the target sub-object and obtaining the query result of the target sub-object.

5. The method according to claim 1, characterized in that, The step of determining whether to intercept the target number based on the query results of the N target sub-objects includes: When the reference number is a number that needs to be intercepted, if the query results of all N target sub-objects exist, then it is determined that the target number needs to be intercepted. When the reference number is a number that does not need to be intercepted, if at least one of the query results of the N target sub-objects does not exist, then it is determined that the target number needs to be intercepted.

6. The method according to claim 1, characterized in that, The reference number is a mobile phone number; before converting the target number into multiple target sub-objects according to the target conversion method after obtaining the target number, the method further includes: After obtaining the user's number in the call request, if the user's number is determined to be a mobile phone number, then the user's number is used as the target number.

7. A number blocking device, characterized in that, The device includes: The mapping module is used to pre-convert the reference number into N reference sub-objects according to the target conversion method, and for each reference sub-object, map and store the reference sub-object into bitmap data, where N is a positive integer; The query module is used to convert the target number into N target sub-objects according to the target conversion method after obtaining the target number, and for each target sub-object, query the bitmap data to see if the target sub-object exists, and obtain the query result of the target sub-object; The judgment module is used to determine whether the target number needs to be intercepted based on the query results of the N target sub-objects; if so, the target number is intercepted. The mapping module is specifically used to perform a first calculation on the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and determine the first reference sub-object and the second reference sub-object as the N reference sub-objects; The query module is specifically used to perform the first calculation on the target number to obtain a first target sub-object, and to perform the second calculation on the target number to obtain a second target sub-object; and to determine the first target sub-object and the second target sub-object as the N target sub-objects; The mapping module is further configured to perform a first calculation on the reference number to obtain a first reference sub-object, perform a second calculation on the reference number to obtain a second reference sub-object, and perform a third calculation on the reference number to obtain a third reference sub-object; and determine the first reference sub-object, the second reference sub-object, and the third reference sub-object as the N reference sub-objects; The query module is further configured to perform the first calculation on the target number to obtain a first target sub-object, perform the second calculation on the target number to obtain a second target sub-object, and perform the third calculation on the target number to obtain a third target sub-object; and determine the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects; The step of performing a first calculation on the reference number to obtain a first reference sub-object includes: Divide the reference number by a set value to obtain a reference quotient, and use the integer part of the reference quotient as the first reference sub-object; Wherein, the set value is n, which is a positive integer with fewer digits than the reference number; The step of performing a second calculation on the reference number to obtain a second reference sub-object includes: The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is bitwise ANDed with the mask binary number with the set number of bits to obtain a first binary number. The decimal number corresponding to the first binary number is used as the second reference sub-object. Wherein, the first m bits of the mask binary number are 0, the last m bits are 1, and m is half of the set number of bits; The third calculation of the reference number to obtain the third reference sub-object includes: The reference number is converted into a reference binary number with a set number of bits, and the reference binary number is right-shifted by m bits to obtain a second binary number. The decimal number corresponding to the second binary number is used as the third reference sub-object; where m is half of the set number of bits.

8. An electronic device, characterized in that, The electronic device includes a processor and a computer-readable storage medium on which a computer program is stored; When the computer program is executed by the processor, the processor performs the number blocking method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the number blocking method as described in any one of claims 1 to 6.