Number interception method and device, electronic equipment and storage medium
Through bitmap data mapping storage and query, the efficiency of number interception is improved, the problem of low number interception efficiency in the existing technology is solved, and faster query operations and higher equipment performance is achieved.
Patent Information
- Application Number
- CN202411155400.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Due to the huge number of reference numbers, the existing number interception methods have low efficiency in the matching authentication process, and thus low interception efficiency.
The reference sub-objects converted from reference numbers are stored using bitmap data map, and the reference sub-objects converted from target numbers are queried based on the bitmap data, and then determine whether the target number needs to be intercepted.
The bitmap data storage method saves a lot of storage space, and the query operation speed is faster, which improves the efficiency of number interception and improves equipment performance.
Smart Images

Figure CN119172471A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a number interception method, device, electronic device and storage medium. Background Art
[0002] Number blocking is an important feature provided by smartphones and communication operators to help users reduce unnecessary harassing calls and fraudulent calls.
[0003] The current number blocking method usually saves a large number of reference numbers (such as numbers to be blocked) locally or in a database or FTP (File Transfer Protocol) file server. When a call number is obtained, the call number is queried from the saved reference numbers to see if the call number exists, and then the number is blocked according to the query result. However, due to the huge number of reference numbers, the matching and authentication process is inefficient, which in turn leads to low efficiency in number blocking. Summary of the invention
[0004] In view of the above problems, the embodiments of the present application propose a number blocking method, device, electronic device and storage medium to improve the efficiency of number blocking.
[0005] According to one aspect of an embodiment of the present application, a number blocking method is provided, the method comprising:
[0006] Convert the reference number into N reference sub-objects in advance according to the target conversion method, and for each of the reference sub-objects, map and store the reference sub-object into the bitmap data, where N is a positive integer;
[0007] After obtaining the target number, converting the target number into N target sub-objects according to the target conversion method, and querying whether the target sub-object exists from the bitmap data for each target sub-object, to obtain a query result of the target sub-object;
[0008] According to the query results of the N target sub-objects, it is determined whether the target number needs to be intercepted, and if so, the target number is intercepted.
[0009] Optionally, the 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 in advance to obtain a first reference sub-object, and performing a second calculation on the reference number to obtain a second reference sub-object; determining the first reference sub-object and the second reference sub-object as the N reference sub-objects;
[0010] The 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, 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; 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 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, 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 value, and use the integer part of the reference quotient value as the first reference sub-object;
[0015] Among them, the set value is 10 n , n is a positive integer less than the number of digits of the reference number.
[0016] Optionally, performing a second calculation on the reference number to obtain a second reference sub-object includes:
[0017] Convert the reference number into a reference binary number of a set number of bits, perform a bitwise AND operation on the reference binary number and the mask binary number of the set number of bits to obtain a first binary number, and use the decimal number corresponding to the first binary number as the second reference sub-object;
[0018] The first m bits of the masked binary number are 0, the last m bits are 1, and m is half of the set number of bits.
[0019] Optionally, performing a third calculation on the reference number to obtain a third reference sub-object includes:
[0020] Convert the reference number into a reference binary number of the set number of bits, right-shift the reference binary number by m bits to obtain a second binary number, and use the decimal number corresponding to the second binary number as the third reference sub-object;
[0021] Wherein, m is half of the set number of bits.
[0022] Optionally, the value of each bit in the bitmap data is initially a first value indicating non-existence; and storing the reference sub-object mapping into the bitmap data comprises:
[0023] The reference sub-object is used as a reference position index of the reference sub-object in the bitmap data, and a value of a bit corresponding to the reference position index in the bitmap data is set to a second value indicating existence.
[0024] Optionally, querying from the bitmap data whether the target sub-object exists to obtain a 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 bit corresponding to the target position index in the bitmap data is used as the query result of the target sub-object.
[0026] Optionally, the bitmap data is N;
[0027] The storing the reference sub-object mapping into the bitmap data comprises: storing the reference sub-object mapping into the bitmap data corresponding to the reference sub-object;
[0028] The querying whether the target sub-object exists in the bitmap data to obtain 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 to obtain the query result of the target sub-object.
[0029] Optionally, judging whether the target number needs to be intercepted according to 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 the N target sub-objects all exist, 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, it is determined that the target number needs to be intercepted.
[0032] Optionally, the reference number is a mobile phone number; after acquiring the target number, before converting the target number into a plurality of target sub-objects according to the target conversion method, the method further includes:
[0033] After obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, the user number is used as the target number.
[0034] According to another aspect of an embodiment of the present application, a number blocking device is provided, the device comprising:
[0035] A mapping module, used for converting the reference number into N reference sub-objects in advance according to a target conversion method, and for each of the reference sub-objects, mapping and storing the reference sub-object into bitmap data, where N is a positive integer;
[0036] A query module, configured to, after obtaining the target number, convert the target number into N target sub-objects according to the target conversion method, and query whether the target sub-object exists from the bitmap data for each target sub-object, so as to obtain a query result of the target sub-object;
[0037] The judging module is used to judge whether the target number needs to be intercepted according to the query results of the N target sub-objects, and if so, intercept the target number.
[0038] Optionally, the mapping module is specifically configured to pre-calculate the reference number to obtain a first reference sub-object, and to pre-calculate the reference number to obtain a second reference sub-object; and to determine the first reference sub-object and the second reference sub-object as the N reference sub-objects;
[0039] The query module is specifically 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 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 configured to pre-calculate the reference number first 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; 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] A first conversion unit, configured to divide the reference number by a set value to obtain a reference quotient value, and use an integer part of the reference quotient value as the first reference sub-object;
[0044] Among them, the set value is 10 n , n is a positive integer less than the number of digits of the reference number.
[0045] Optionally, the mapping module includes:
[0046] A second conversion unit is used to convert the reference number into a reference binary number of a set number of bits, and perform a bitwise AND operation on the reference binary number and the mask binary number of the set number of bits to obtain a first binary number, and use a decimal number corresponding to the first binary number as the second reference sub-object;
[0047] The first m bits of the masked binary number are 0, the last m bits are 1, and m is half of the set number of bits.
[0048] Optionally, the mapping module includes:
[0049] A third conversion unit is used to convert the reference number into a reference binary number of the set number of bits, and right-shift the reference binary number by m bits to obtain a second binary number, and use the decimal number corresponding to the second binary number as the third reference sub-object;
[0050] Wherein, m is half of the set number of bits.
[0051] Optionally, the value of each bit in the bitmap data is initially 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 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 numerical value of the bit corresponding to the target position index in the bitmap data as the query result of the target sub-object.
[0053] Optionally, the bitmap data is N;
[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 from the bitmap data corresponding to the target sub-object, and obtain the query result of the target sub-object.
[0056] Optionally, the judging module includes:
[0057] A first determining unit, configured to determine that the target number needs to be intercepted if the query results of the N target sub-objects all exist when the reference number is a number that needs 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 comprises: a determination module for, after obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, using the user number as the target number.
[0060] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the number blocking method as described in any one of the above items.
[0061] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the number blocking method as described in any one of the above items.
[0062] In an embodiment of the present application, bitmap data mapping is used to store reference sub-objects converted from a reference number, and a query is made based on the bitmap data to determine whether a target sub-object converted from a target number exists, and then whether the target number needs to be intercepted is determined based on the query result of the target sub-object. If so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, a large amount of storage space can be saved by storing bitmap data compared to storing the entire reference number, and the query operation of the bitmap data is a simple read operation on the bits therein, so the query operation is faster, thereby improving the efficiency of number interception and improving the performance of the number interception device.
[0063] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solution of the embodiment of the present application, the drawings required for use in the description of the embodiment of the present application will be briefly introduced below. Obviously, the drawings described below are only some drawings of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0065] Figure 1 This is a flowchart of the steps of a number blocking method according to an embodiment of the present application;
[0066] Figure 2 is a schematic diagram of bitmap data in an embodiment of the present application;
[0067] Figure 3 is a flow chart of a number blocking method according to an embodiment of the present application;
[0068] Figure 4 is a structural block diagram of a number interception device according to an embodiment of the present application;
[0069] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application;
[0070] Figure 6 It is a structural block diagram of a computer-readable storage medium in an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] Reference Figure 1 , showing a step flow chart of a number blocking method according to an embodiment of the present application.
[0073] like Figure 1 As shown, the number blocking method may include the following steps:
[0074] Step 101 : converting a reference number into N reference sub-objects in advance according to a target conversion method, and mapping and storing each reference sub-object into bitmap data.
[0075] In the embodiment of the present application, the reference number refers to a number that needs to be saved as a basis for number blocking.
[0076] For example, the reference number may 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 may be a fraudulent phone number, an advertising and promotion phone number, a harassing phone number, etc. For example, the number that does not need to be blocked may be other phone numbers other than the above numbers that need to be blocked, etc.
[0077] In the embodiment of the present application, the reference sub-object refers to a sub-object converted from a reference number, wherein the reference sub-object may be a numerical value obtained by calculating the reference number, or may be a partial number in an extracted reference number.
[0078] The specific value of N can be set according to actual needs, and this embodiment does not limit this. For example, N can be set to 2, 3, etc.
[0079] In an optional implementation, the process of converting a reference number into N reference sub-objects in advance according to a target conversion method may include: performing a first calculation on the reference number in advance to obtain a first reference sub-object, and 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] Exemplarily, the process of performing a first calculation on the reference number to obtain the first reference sub-object may include: dividing the reference number by a set value to obtain a reference quotient value, and using the integer part of the reference quotient value as the first reference sub-object. The set 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 manner, 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 of the reference number and n.
[0082] For example, if the reference number is an 11-digit mobile phone number, set the value 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 mentioned above can be set according to actual needs, and this embodiment does not limit this.
[0084] Exemplarily, 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 on the reference binary number and a mask binary number of the set number of bits to obtain a first binary number, and using a 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 of a set number of bits, the reference number can be first converted into a binary number, and this binary number is called an initial reference binary number. If the number of bits of 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 padded zeros and the number of bits of the initial reference binary number reaches the set number of bits. The resulting binary number is the reference binary number of the set number of bits.
[0086] The reference number is a decimal number. For the process of converting the decimal number into a binary number, any applicable method can be selected based on practical experience.
[0087] For example, the decimal number can be converted to binary number through the "divide by 2 and take the remainder method" or "program calculation method".
[0088] For example, the process of "division by 2 and remainder method" is as follows:
[0089] (1) Divide the 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 a digit 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) Arrange the remainders in reverse order: Arrange all the remainders recorded in reverse order (that is, the first remainder is placed in the lowest position, and the last remainder is placed in the highest position). The number obtained in this way is the binary representation of the original decimal number.
[0093] In the process of performing a bitwise AND operation on the reference binary number and the mask binary number of the set bit number, the bitwise AND operation refers to performing a logical AND operation on each bit in the reference binary number and the corresponding bit in the mask binary number, and if the values of the bit to be subjected to the bitwise AND operation in both the reference binary number and the mask binary number are 1, the bitwise AND operation result of the bit is 1, otherwise the bitwise AND operation result of the bit 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 above-mentioned set number of bits can be set according to actual needs, and this embodiment does not limit this. The set number of bits can be an even number, specifically a multiple of 2, such as 64 bits, 128 bits, and so on.
[0095] For example, if the set bit number is 64 bits, and the bit number of the initial reference binary number converted from the reference number is 34 bits, 30 zeros are added in front of the first digit of the initial reference binary number to obtain a 64-bit reference binary number. The first 32 bits of the masked binary number are all 0, and the last 32 bits are all 1. The 64-bit reference binary number is bitwise ANDed with the 64-bit masked binary number, and the first 32 bits of the first binary number obtained are all 0, 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, the first binary number is 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 into decimal numbers, any applicable method can be selected based on practical experience.
[0098] For example, you can go 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 there is a binary number b n b n-1 ...b1b0, where b n is the most significant bit (the leftmost bit), and b0 is the least significant bit (the rightmost bit). The rightmost bit (b0) is multiplied by 2 0 , the next bit (b1) is multiplied by 2 1 , and so on, until the highest position (b n ) multiplied by 2 n , and finally add up all the products to get the decimal number corresponding to the binary number.
[0100] In an optional implementation, the process of converting a reference number into N reference sub-objects in advance according to a target conversion method may include: performing a first calculation on the reference number in advance 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] Exemplarily, 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, right-shifting the reference binary number by m bits to obtain a second binary number, and using a decimal number corresponding to the second binary number as the third reference sub-object, where m is half of the set number of bits.
[0102] For the process of converting the reference number into a reference binary number of a set number of digits, reference may be made to the above related description, and this embodiment will not be discussed in detail here.
[0103] In the process of performing the right shift operation on the reference binary number by m bits, the last m bits of the reference binary number are deleted, and a 0 is added in front of the first number of the reference binary number, specifically, m 0s are added. Therefore, in the second binary number obtained by performing the right shift operation on the reference binary number by m bits, the first m bits are 0, and the last m bits are the first m bits of the reference binary number.
[0104] For example, if the set number of bits is 64, and the number of bits of the initial reference binary number converted from the reference number is 34, 30 zeros are added in front of the first digit of the initial reference binary number to obtain a 64-bit reference binary number. The 64-bit reference binary number is right-shifted by 32 bits, and the first 32 bits of the obtained second binary number are all 0, and the last 32 bits are the first 32 bits of the reference binary number.
[0105] After obtaining the second binary number, since the second binary number is a binary number, the second binary number is converted into a decimal number, and the decimal number corresponding to the second binary number is used as the third reference sub-object. For the specific conversion process, reference may be made to the relevant description above, and this embodiment will not be discussed in detail here.
[0106] After the reference number is converted into N reference sub-objects, the reference sub-object mapping is stored in bitmap data for each of the reference sub-objects.
[0107] Bitmap data is a data structure that represents a dense set in a finite field. Each element appears at least once, and no other data is associated with the element. Bitmap data is a compact data structure used to represent the state of elements (existence or non-existence) in a set or sequence of fixed size. Bitmap data represents the state of elements in a set through a bit array, with each element corresponding to a bit, thereby achieving efficient space and time performance.
[0108] In an embodiment of the present application, bitmap data that can meet storage requirements is set, the bitmap data includes multiple bits, each bit has a corresponding position index, and the value of each bit in the bitmap data is initially a first value indicating non-existence.
[0109] Exemplarily, the process of mapping and storing the reference sub-object into the bitmap data may include: using the reference sub-object as a reference position index of the reference sub-object 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 existence. It should be noted that the reference position index is the position index corresponding to the bit in the bitmap data, and in this embodiment, it is referred to as the reference position index for the convenience of distinction.
[0110] For example, if the reference sub-object is 1561, the bit with position index 1561 in the bitmap data is set to a second value indicating existence.
[0111] The specific forms of the first value and the second value can be set according to actual needs, and this embodiment does not limit this. For example, the first value can be set to 0, the second value can be set to 1, and so on.
[0112] Step 102, after obtaining the target number, convert the target number into N target sub-objects according to the target conversion method, and query whether the target sub-object exists from the bitmap data for each target sub-object to obtain the query result of the target sub-object.
[0113] In the embodiment of the present application, the call request is monitored, and after the call request is monitored, the call request can be temporarily intercepted, and a target number is obtained from the call request. The target number refers to the number that needs to be determined whether it needs to be intercepted.
[0114] In the embodiment of the present application, the target sub-object refers to the sub-object converted from the target number. The target sub-object can be a numerical value obtained by calculating the target number, or a partial number extracted from the target number. The number of target sub-objects converted from a target number is the same as the number of reference sub-objects converted from a reference number.
[0115] In an 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 first calculation process of the reference number, and the second calculation is the same as the second calculation in the second calculation process of the reference number.
[0116] In an 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 performing the third calculation on the target number to obtain a third target sub-object; determining the first target sub-object, the second target sub-object, and the third target sub-object as the N target sub-objects. The first calculation is the same as the first calculation in the first calculation process of the reference number, the second calculation is the same as the second calculation in the second calculation process of the reference number, and the third calculation is the same as the second calculation in the third calculation process of the reference number.
[0117] Exemplarily, 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 set value to obtain a target quotient value, and using the integer part of the target quotient value as the first target sub-object. The set value is the same as the set value in the process of performing a first calculation on the reference number to obtain the first reference sub-object.
[0118] Exemplarily, the process of performing a second calculation on the target number to obtain the second target sub-object may include: converting the target number into a target binary number of the set number of bits, performing a bitwise AND operation on the target binary number and the 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. The set number of bits is the same as the set number of bits in the process of performing a second calculation on the reference number to obtain the 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] Exemplarily, 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 the set number of digits, and performing a right shift operation on the target binary number by m digits to obtain a fourth binary number, and using the decimal number corresponding to the fourth binary number as the third target sub-object. The set number of digits is the same as the set number of digits in the process of performing a third calculation on the reference number to obtain the third reference sub-object, and m is half of the set number of digits.
[0120] After the target number is converted into N target sub-objects, for each of the target sub-objects, it is queried from the bitmap data whether the target sub-object exists, and a query result of the target sub-object is obtained.
[0121] Exemplarily, 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: taking the target sub-object as the target position index of the target sub-object in the bitmap data, and taking the numerical value of the bit corresponding to the target position index in the bitmap data as the query result of the target sub-object.
[0122] The query result of the target sub-object can indicate whether the target sub-object exists in the bitmap data. When the query result of the target sub-object is a first value indicating non-existence (such as 0), it indicates that the target sub-object does not exist in the bitmap data; when the query result of the target sub-object is a second value indicating existence (such as 1), it indicates that the target sub-object exists in the bitmap data.
[0123] For example, if the target sub-object is 1561, the value of the bit with position index 1561 in the bitmap data is used as the query result of the target sub-object.
[0124] In an optional embodiment, the number of the bitmap data may be N, that is, the number of the bitmap data is the same as the number of the reference sub-objects converted from a reference number, and each reference sub-object converted from a reference number corresponds to a bitmap data. At the same time, the number of the bitmap data is the same as the number of the target sub-objects converted from a target number, and each target sub-object converted from a target number corresponds to a bitmap data.
[0125] Exemplarily, the process of storing the reference sub-object mapping into bitmap data may include: storing the reference sub-object mapping into the bitmap data corresponding to the reference sub-object.
[0126] Exemplarily, the process of querying whether the target sub-object exists from the bitmap data and obtaining the query result of the target sub-object may include: querying whether the target sub-object exists from the bitmap data corresponding to the target sub-object and obtaining the query result of the target sub-object.
[0127] Reference Figure 2 , shows a schematic diagram of a bitmap data of an embodiment of the present application. Figure 2 As shown, it includes bitmap data 1, bitmap data 2 and bitmap data 3, and each bit in each bitmap data corresponds to its own position index (for example Figure 2 00000001, 00000002, 00000003, etc.), the value of each bit is 0 (indicating non-existence) or 1 (indicating existence). After converting the reference number into three sub-objects, each sub-object is mapped and stored in a bitmap data corresponding to itself. After converting the target number into three target sub-objects, a bitmap data corresponding to each sub-object is queried to determine whether the target sub-object exists.
[0128] For the specific mapping storage and query process, reference may be made to the above related description, and this embodiment will not be discussed in detail here.
[0129] By setting multiple bitmap data, different types of reference sub-objects are stored separately, which can reduce the data volume of each bitmap data, thereby improving the efficiency of mapping storage and query.
[0130] In an optional implementation, the reference number may 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, it may also include: after obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, the user number is used as the target number; if it is determined that the user number is not a mobile phone number, the user number will not be used as the target number, so the process of converting the target number into multiple target sub-objects according to the target conversion method after obtaining the target number will not be performed, so the user number in the call request may not be intercepted.
[0131] The specific process of determining whether a user number is a mobile phone number can be processed in any suitable manner based on actual experience, and this embodiment does not limit this. For example, based on the characteristics of the mobile phone number, such as the number of digits in the mobile phone number, and the fact that each digit in the mobile phone number is a number, it can be determined whether the user number meets the characteristics of the mobile phone number, and if so, it is determined that the user number is a mobile phone number, otherwise it is determined that the user number is not a mobile phone number.
[0132] Step 103: determine whether the target number needs to be intercepted based on the query results of the N target sub-objects, and if so, intercept the target number.
[0133] In an optional implementation, the process of determining whether the target number needs to be intercepted 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 the query results of the N target sub-objects are all true, determining 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, determining that the target number needs to be intercepted.
[0134] When the query results of the N target sub-objects are all present, it indicates that the target number exists in the bitmap data; when at least one of the query results of the N target sub-objects is not present, it indicates that the target number does not exist in the bitmap data.
[0135] For example, the first numerical value indicating non-existence is set to 0, and the first numerical value indicating existence is set to 1, and the target number is converted into the first target sub-object, the second target sub-object and the 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, 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] When it is determined that the target number needs to be intercepted, the target number can be intercepted, and the specific interception method can be handled according to actual experience. When it is determined that the target number does not need to be intercepted, the target number is not intercepted, and the call request continues to be forwarded to the next destination (such as forwarded to the called user, etc.).
[0137] In the embodiment of the present application, a reference sub-object converted from a reference number is stored by using bitmap data mapping, and a query based on the bitmap data is made to see whether a target sub-object converted from a target number exists, and then a judgment is made based on the query result of the target sub-object whether the target number needs to be intercepted, and if so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, a large amount of storage space can be saved by using the bitmap data storage method compared to storing the entire reference number, and the query operation of the bitmap data is a simple read operation of the bits therein, so the query operation speed is faster, thereby improving the efficiency of number interception and the performance of the number interception device.
[0138] Reference Figure 3 , showing a flow chart of a number blocking method in an embodiment of the present application.
[0139] like Figure 3 As shown, the number blocking method may include:
[0140] The reference number (specifically, the mobile phone number) is converted to obtain N reference sub-objects, and bitmap data is generated according to the reference sub-objects. This process corresponds to the above step 101.
[0141] Access authentication and obtain the user number in the call request.
[0142] Determine whether the user number is a mobile phone number. If yes, proceed to the next step; if not, the authentication fails.
[0143] The user number is used as the target number, and the target number is converted to obtain N target sub-objects.
[0144] Match N target sub-objects to the bitmap data.
[0145] Determine whether all N target sub-objects exist in the bitmap data. If yes, the authentication is passed; if not, the authentication is failed.
[0146] Among them, if the authentication is successful, it can be said that the target number exists in the bitmap data, and if the authentication is unsuccessful, it can be said that the target number does not exist in the bitmap data.
[0147] In the embodiment of the present application, by converting the number into multiple sub-objects for processing, the scenario in which it can be used is more extensive and is not limited by the number of digits.
[0148] Reference Figure 4 , shows a structural block diagram of a number blocking device according to an embodiment of the present application.
[0149] like Figure 4 As shown, the number blocking device may include the following modules:
[0150] A mapping module 401 is used to convert the reference number into N reference sub-objects in advance according to a target conversion method, and for each of the reference sub-objects, 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 query whether the target sub-object exists from the bitmap data for each target sub-object, so as to obtain the query result of the target sub-object;
[0152] The judgment module 403 is used to judge whether the target number needs to be intercepted according to the query results of the N target sub-objects, and if so, intercept the target number.
[0153] Optionally, the mapping module 401 is specifically configured to pre-calculate the reference number to obtain a first reference sub-object, and to pre-calculate the reference number to obtain a second reference sub-object; and to 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 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 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 configured to pre-calculate the reference number first 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; 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] A first conversion unit, configured to divide the reference number by a set value to obtain a reference quotient value, and use an integer part of the reference quotient value as the first reference sub-object;
[0159] Among them, the set value is 10 n , n is a positive integer less than the number of digits of the reference number.
[0160] Optionally, the mapping module 401 includes:
[0161] A second conversion unit is used to convert the reference number into a reference binary number of a set number of bits, and perform a bitwise AND operation on the reference binary number and the mask binary number of the set number of bits to obtain a first binary number, and use a decimal number corresponding to the first binary number as the second reference sub-object;
[0162] The first m bits of the masked binary number are 0, the last m bits are 1, and m is half of the set number of bits.
[0163] Optionally, the mapping module 401 includes:
[0164] A third conversion unit is used to convert the reference number into a reference binary number of the set number of bits, and right-shift the reference binary number by m bits to obtain a second binary number, and use the decimal number corresponding to the second binary number as the third reference sub-object;
[0165] Wherein, m is half of the set number of bits.
[0166] Optionally, the value of each bit in the bitmap data is initially 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, configured to use the target sub-object as the target position index of the target sub-object in the bitmap data, and use the numerical value of the bit corresponding to the target position index in the bitmap data as the query result of the target sub-object.
[0168] Optionally, the bitmap data is N;
[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 configured to query whether the target sub-object exists from the bitmap data corresponding to the target sub-object, and obtain a query result of the target sub-object.
[0171] Optionally, the judging module 403 includes:
[0172] A first determining unit, configured to determine that the target number needs to be intercepted if the query results of the N target sub-objects all exist when the reference number is a number that needs 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 comprises: a determination module for, after obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, using the user number as the target number.
[0175] In the embodiment of the present application, a reference sub-object converted from a reference number is stored by using bitmap data mapping, and a query based on the bitmap data is made to see whether a target sub-object converted from a target number exists, and then a judgment is made based on the query result of the target sub-object whether the target number needs to be intercepted, and if so, the target number is intercepted. Since each reference sub-object can be mapped to a bit in the bitmap data, a large amount of storage space can be saved by using the bitmap data storage method compared to storing the entire reference number, and the query operation of the bitmap data is a simple read operation of the bits therein, so the query operation speed is faster, thereby improving the efficiency of number interception and the performance of the number interception device.
[0176] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0177] In an embodiment of the present application, an electronic device is also provided. The electronic device may include a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the number blocking method of any of the above embodiments.
[0178] Reference Figure 5 , shows a structural block diagram of an electronic device according to an embodiment of the present 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 executing the computer program 5021, the processor 501 implements the number blocking method of any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated 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), electronic erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.
[0182] In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored. The computer program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the number blocking method described in any of the above embodiments.
[0183] Reference Figure 5 , shows a block diagram of a computer-readable storage medium according to an embodiment of the present application. Figure 5 As shown, a computer program 501 is stored on a computer-readable storage medium 50. When the computer program 501 is executed by a processor, the processor executes the number blocking method described in any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0184] The various embodiments in this specification are interrelated, and each embodiment is described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.
[0185] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0186] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0188] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0189] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0190] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0191] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0194] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A number blocking method, characterized in that: The method comprises: Convert the reference number into N reference sub-objects in advance according to the target conversion method, and for each of the reference sub-objects, map and store the reference sub-object into the bitmap data, where N is a positive integer; After obtaining the target number, converting the target number into N target sub-objects according to the target conversion method, and querying whether the target sub-object exists from the bitmap data for each target sub-object, to obtain a query result of the target sub-object; According to the query results of the N target sub-objects, it is determined whether the target number needs to be intercepted, and if so, the target number is intercepted.
2. The method according to claim 1, characterized in that The 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; The 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.
3. The method according to claim 1, characterized in that 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; The 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.
4. The method according to claim 2 or 3, characterized in that: The 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 value, and use the integer part of the reference quotient value as the first reference sub-object; Among them, the set value is 10 n , n is a positive integer less than the number of digits of the reference number.
5. The method according to claim 2 or 3, characterized in that: The performing a second calculation on the reference number to obtain a second reference sub-object comprises: Convert the reference number into a reference binary number of a set number of bits, perform a bitwise AND operation on the reference binary number and the mask binary number of the set number of bits to obtain a first binary number, and use the decimal number corresponding to the first binary number as the second reference sub-object; The first m bits of the masked binary number are 0, the last m bits are 1, and m is half of the set number of bits.
6. The method according to claim 5, characterized in that The performing a third calculation on the reference number to obtain a third reference sub-object comprises: The reference number is converted into a reference binary number of the set number of bits, and the reference binary number is right-shifted by m bits to obtain a second binary number, and the decimal number corresponding to the second binary number is used as the third reference sub-object; wherein m is half of the set number of bits.
7. The method according to claim 1, characterized in that The value of each bit in the bitmap data is initially a first value indicating non-existence; and the mapping and storing the reference sub-object into the bitmap data comprises: The reference sub-object is used as a reference position index of the reference sub-object in the bitmap data, and a value of a bit corresponding to the reference position index in the bitmap data is set to a second value indicating existence.
8. The method according to claim 7, characterized in that The querying whether the target sub-object exists in the bitmap data to obtain 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 bit corresponding to the target position index in the bitmap data is used as the query result of the target sub-object.
9. The method according to claim 1, characterized in that: The number of bitmap data is N; The storing the reference sub-object mapping into the bitmap data comprises: storing the reference sub-object mapping into the bitmap data corresponding to the reference sub-object; The querying whether the target sub-object exists in the bitmap data to obtain 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 to obtain the query result of the target sub-object.
10. The method according to claim 1, characterized in that The determining whether the target number needs to be intercepted according to 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 the N target sub-objects all exist, 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, it is determined that the target number needs to be intercepted.
11. The method according to claim 1, characterized in that: The reference number is a mobile phone number; after acquiring the target number, before converting the target number into a plurality of target sub-objects according to the target conversion method, the method further includes: After obtaining the user number in the call request, if it is determined that the user number is a mobile phone number, the user number is used as the target number.
12. A number blocking device, characterized in that: The device comprises: A mapping module, used for converting the reference number into N reference sub-objects in advance according to a target conversion method, and for each of the reference sub-objects, mapping and storing the reference sub-object into bitmap data, where N is a positive integer; A query module, configured to, after obtaining the target number, convert the target number into N target sub-objects according to the target conversion method, and query whether the target sub-object exists from the bitmap data for each target sub-object, so as to obtain a query result of the target sub-object; The judging module is used to judge whether the target number needs to be intercepted according to the query results of the N target sub-objects, and if so, intercept the target number.
13. An electronic device, characterized in that: The electronic device comprises a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program; When the computer program is executed by the processor, the processor is enabled to execute the number blocking method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the number blocking method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Number classification method and device
CN113111894A
Blacklist strategy matching method and device, electronic equipment and storage medium
CN114143083A
Blacklist number checking method based on bitmap structure
CN118152376A
Tag-based application of masking policy
US11593521B1
