CN104936210A - Method of determining number state and device of determining number state - Google Patents

Method of determining number state and device of determining number state Download PDF

Info

Publication number
CN104936210A
CN104936210A CN201510188758.7A CN201510188758A CN104936210A CN 104936210 A CN104936210 A CN 104936210A CN 201510188758 A CN201510188758 A CN 201510188758A CN 104936210 A CN104936210 A CN 104936210A
Authority
CN
China
Prior art keywords
subscript value
subscript
memory bitmap
character string
key assignments
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510188758.7A
Other languages
Chinese (zh)
Other versions
CN104936210B (en
Inventor
尹为强
罗云彬
赵锡成
王伟华
博格利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201510188758.7A priority Critical patent/CN104936210B/en
Publication of CN104936210A publication Critical patent/CN104936210A/en
Application granted granted Critical
Publication of CN104936210B publication Critical patent/CN104936210B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention discloses a method of determining a number state and a device of determining the number state which relate to the communication technology field, and can improve the accuracy of querying whether a mobile phone number generates the 3G networking flow. The method of the embodiment of the present invention comprises the steps of using a server to obtain the corresponding first and second subscript values of a number in a first memory bitmap; using the server to obtain a character string according to the first and second subscript values; using the server to obtain the corresponding third and fourth subscript values of the character string in a second memory bitmap according to the character string; using the server to set a key value of the corresponding position of a third subscript value and the key value of the corresponding position of a fourth subscript value in the second memory bitmap according to a preset rule; and using the server to determine the state of the number according to a key value of the corresponding position of a first subscript value and a key value of the corresponding position of a second subscript value in the first memory bitmap, and the key value of the corresponding position of the third subscript value and the key value of the corresponding position of the fourth subscript value in the second memory bitmap. The present invention is suitable for determining the number state.

Description

A kind of method and device determining number state
Technical field
The present invention relates to communication technical field, particularly relate to a kind of method and the device of determining number state.
Background technology
Along with the development of the communication technology, especially network is universal, and most of user can surf the Net by the mobile terminal such as choice for use mobile phone, and then produces a large amount of surfing flow information.Supplier, in order to find interested data from a large amount of surfing flow information, needs first to carry out analyzing and processing to a large amount of surfing flow information.In the prior art, for cellphone subscriber, supplier needs to store phone number, mark and the operation such as inquiry.
At present, server can utilize hash algorithm to carry out map tag to phone number in memory bitmap, but can produce key assignments conflict in labeling process.When the quantity of the phone number needing map tag is larger, the probability producing key assignments conflict in labeling process also can improve.Therefore, after server by utilizing hash algorithm marks phone number in memory bitmap, determine whether phone number produces in the process of 3G surfing flow by mark result, easily the phone number not producing 3G surfing flow is defined as the phone number creating 3G surfing flow.
Summary of the invention
The embodiment of the present invention provides a kind of method and the device of determining number state, can improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
For achieving the above object, the embodiment of the present invention adopts following technical scheme:
First aspect, the embodiment of the present invention provides a kind of method determining number state, and described method comprises:
Server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value;
Described server obtains character string according to described first subscript value and described second subscript value;
Described server obtains the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string;
Described server arranges the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and the key assignments of described 4th subscript value correspondence position according to preset rules, and described preset rules is for distinguishing the number producing number state information and the number not producing number state information;
Described server is according to the key assignments of the key assignments of the first subscript value correspondence position described in described first memory bitmap and described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
Second aspect, the embodiment of the present invention provides a kind of device determining number state, and described device comprises:
Acquisition module, for obtaining the first corresponding in the first memory bitmap subscript value of number and the second subscript value;
Generation module, for obtaining character string according to described first subscript value and described second subscript value;
Computing module, for obtaining the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string;
Module is set, for the key assignments of the key assignments and described 4th subscript value correspondence position that arrange the 3rd subscript value correspondence position described in described second memory bitmap according to preset rules, described preset rules is for distinguishing the number producing number state information and the number not producing number state information;
Determination module, for according to the key assignments of the first subscript value correspondence position described in described first memory bitmap and the key assignments of described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
A kind of method and device determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, according to the key assignments of four subscript value correspondence positions, the embodiment of the present invention by carrying out map tag to phone number in two memory bitmap, can determine whether phone number produces 3G surfing flow afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
A kind of flow chart determining the method for number state that Fig. 1 provides for the embodiment of the present invention;
Fig. 2 determines the flow chart of the method for number state for another kind that the embodiment of the present invention provides;
Fig. 3 determines the flow chart of the method for number state for another kind that the embodiment of the present invention provides;
Structural representation under a kind of embody rule scene that Fig. 4 provides for the embodiment of the present invention;
Fig. 5 determines the flow chart of the method for number state for another kind that the embodiment of the present invention provides;
Fig. 6 determines the flow chart of the method for number state for another kind that the embodiment of the present invention provides;
A kind of structural representation determining the device of number state that Fig. 7 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The term used in embodiments of the present invention is only for the object describing specific embodiment, and not intended to be limiting the present invention." one " and " described " of the singulative used in the embodiment of the present invention and appended claims is also intended to comprise most form, unless context clearly represents other implications.
The present invention is applicable to determine number state, and wherein, number state can comprise: whether number produces 3G (3rd Generation, third generation digital communication) surfing flow, whether number produces roaming data etc.For convenience of description, in embodiments of the present invention, to determine whether phone number produces 3G surfing flow and be described.
The embodiment of the present invention provides a kind of method determining number state, and as shown in Figure 1, described method comprises:
101, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value.
When needs are 1.93 hundred million by mapping the quantity of the phone number marked, server can apply for the memory bitmap of 300,000,000 bit positions, and the key assignments of all subscript value correspondence positions in memory bitmap is initialized as 0.Server reads surfing flow information record corresponding to 1.93 hundred million phone numbers line by line, and parses the data of the 3G surfing flow that phone number and phone number produce.Whether the 3G surfing flow that the phone number that every bar information that judges server records uses is greater than 0, when the 3G surfing flow that phone number uses is greater than 0, two different Hash functions (hash function) are used to calculate two subscript values according to phone number, i.e. the first subscript value and the second subscript value, in memory bitmap, find this two subscript value correspondence positions, the key assignments of these two subscript value correspondence positions is set to 1 simultaneously; When the 3G surfing flow that phone number uses is less than 0, do not carry out key assignments setting.Repeat aforesaid operations, until surfing flow information corresponding for 1.93 hundred million phone numbers stored all be mapped in memory bitmap.
Whether the Hash function that server needs use two not identical, produce 3G surfing flow to phone number and mark, such as: server uses Hash function 1 and Hash function 2 to calculate phone number
18612345678 the first subscript values corresponding in the first memory bitmap and the second subscript value, wherein, the first memory bitmap is the memory bitmap of above-mentioned 300,000,000 bit positions; What calculated by Hash function 1 is the first subscript value,
What calculated by Hash function 2 is the second subscript value.
Two Hash functions are used to calculate the process of subscript value, as shown in Table 1:
Table one
The calculation procedure that use Hash function 1 calculates the first subscript value is as follows:
Obtain phone number 18612345678, and carry out preliminary treatment to obtained phone number 18612345678, wherein, the phone number after preliminary treatment is identical with former phone number; Phone number after preliminary treatment is calculated according to MD5 (Message-Digest Algorithm 5, Message-Digest Algorithm 5), obtains 6e2b1ca3675119d8edbad42d6d589817; Calculate hash value, obtain-479003662; By hash value and shaping maximum MAX_INT phase with, obtain 1668479986; By above-mentioned with result 1668479986 to 300,000,000 deliverys, obtain the first subscript value 168479986.
Hash function 2 is used to calculate the calculation procedure of the second subscript value and to use Hash function 1 to calculate the calculation procedure of the first subscript value similar, wherein, pretreated result is different, use in the computational process of Hash function 1, the phone number obtained after phone number preliminary treatment is identical with former phone number, use in the computational process of Hash function 2, the phone number obtained after phone number preliminary treatment the front three of former phone number is moved on to latter three to obtain.
It should be noted that, because hash value may be negative, conveniently map, can by hash value by calculating nonnegative integer, such as: by by hash value and shaping maximum MAX_INT phase with obtain nonnegative integer; Because the first memory bitmap takies the memory space of 300,000,000 bit positions, in computational process, by by with result 300,000,000 deliverys are guaranteed that the subscript value calculated is [0,300000000) in interval range, thus ensure that the subscript value calculated is in the position that the memory space shared by the first memory bitmap is corresponding.
102, described server obtains character string according to described first subscript value and described second subscript value.
Character string 168479986_73579646, character string 168479986*73579646 or other forms of character string can be obtained according to the first subscript value 168479986 obtained in above-mentioned steps 101 and the second subscript value 73579646.
103, described server obtains the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string.
Similar with the computational methods in above-mentioned steps 101, Hash function 3 and Hash function 4 can be passed through, or calculate the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value by other two different hash functions, can also process character string by other means, thus obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value.
104, described server arranges the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and the key assignments of described 4th subscript value correspondence position according to preset rules.
Wherein, described preset rules is for distinguishing the number producing number state information and the number not producing number state information.Such as: preset rules may be used for distinguishing the phone number producing 3G surfing flow and the phone number not producing 3G surfing flow, when phone number produces 3G surfing flow, in the second memory bitmap, the key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position are set to 1; When phone number does not produce 3G surfing flow, in the second memory bitmap, the key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position remain unchanged.Or, preset rules can also be used for distinguishing the phone number producing roaming data and the phone number not producing roaming data, when phone number produces roaming data, in the second memory bitmap, the key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position are set to 1; When phone number does not produce roaming data, in the second memory bitmap, the key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position remain unchanged.
In embodiments of the present invention, number state information can be the information producing 3G surfing flow.Server can arrange according to preset rules the key assignments of phone number the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position that produce 3G surfing flow respectively, and does not produce the key assignments of phone number the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position of 3G surfing flow.
105, described server is according to the key assignments of the key assignments of the first subscript value correspondence position described in described first memory bitmap and described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
After the step 101-104 that is finished, whether produce in the process of 3G surfing flow at inquiry mobile phone number, need to calculate the first subscript value corresponding to phone number and the second subscript value by the Hash function 1 in step 101 and Hash function 2, and obtain the key assignments of the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position; The 3rd subscript value corresponding to character string and the 4th subscript value is calculated again by step 103, namely three subscript value of phone number in the second memory bitmap and the 4th subscript value, and obtain the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position; According to the key assignments of the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine whether phone number produces 3G surfing flow.Such as: when the key assignments of the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position in memory bitmap and the key assignments of the 4th subscript value correspondence position when being all 1, phone number produces 3G surfing flow; When the key assignments of the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second any one key assignments in the key assignments of the 3rd subscript value correspondence position in memory bitmap and the key assignments of the 4th subscript value correspondence position when not being 1, phone number does not produce 3G surfing flow.
A kind of method determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, according to the key assignments of four subscript value correspondence positions, the embodiment of the present invention by carrying out map tag to phone number in two memory bitmap, can determine whether phone number produces 3G surfing flow afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
In another implementation of the embodiment of the present invention, on the basis of implementation as shown in Figure 1, step 103 can also be implemented as step 1031 as shown in Figure 2:
1031, described character string is calculated described character string described 3rd subscript value corresponding in the second memory bitmap and described 4th subscript value by hash function by described server.
It should be noted that, the first subscript value, the second subscript value, the 3rd subscript value and the 4th subscript value all can use hash function to calculate.For same number, when using identical hash function to calculate the subscript value in same memory bitmap, identical result can be obtained, therefore, in order to reduce the probability producing key assignments conflict, not identical with the hash function of the second subscript value for calculating the first subscript value, not identical with the hash function of the 4th subscript value for calculating the 3rd subscript value.
A kind of method determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and character string is calculated the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value by hash function, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, the embodiment of the present invention can by carrying out map tag to phone number in two memory bitmap, wherein, also be use hash function by the method for character string maps, by calculating the 3rd subscript value and the 4th subscript value, thus realize the mapping of phone number in the second memory bitmap, determine whether phone number produces 3G surfing flow according to the key assignments of four subscript value correspondence positions afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
In another implementation of the embodiment of the present invention, during by character string maps to the second memory bitmap, 3rd subscript value correspondence position is positioned at the front X position of the second memory bitmap, and the 4th subscript value correspondence position is arranged in the position of the second memory bitmap except front X position.Therefore, on the basis of implementation as shown in Figure 2, can also be embodied as implementation as shown in Figure 3, wherein, step 1031 can be implemented as step 10311-10313:
10311, described character string is calculated described character string described 3rd subscript value corresponding in the described front X position of described second memory bitmap by the first hash function by described server.
10312, described character string is calculated the 4th corresponding in described second memory bitmap subscript probable value of described character string by the second hash function by described server.
10313, described server by described 4th subscript probable value and described X by calculating described 4th subscript value corresponding to the position of described character string in described second memory bitmap except described front X position.
Use method similar in step 101, calculating character string, at the 3rd subscript value corresponding to the second memory bitmap and the 4th subscript probable value, afterwards according to the 4th subscript probable value and the X calculated, obtains the 4th subscript value.As shown in Figure 4, by the second memory bitmap being divided into front X position and the position except front X position, and respectively by the position in X position before character string maps to the second memory bitmap and the second memory bitmap except front X position, can guarantee that the character string that phone number is corresponding corresponds to X position before the second memory bitmap through the 3rd subscript value that hash function calculates, and correspond to the position in the second memory bitmap except front X position through the 4th subscript value that hash function calculates, decrease the result calculated through hash function and all concentrate on X position or the position except front X position before the second memory bitmap, thus reduce the probability of key assignments conflict.
It should be noted that, in a preferred approach, the value of X can be set to the half of bit position shared by the second memory bitmap, such as: memory space shared by the second memory bitmap is the value of 300,000,000 bit, X can be 1.5 hundred million.In addition, the step execution sequence shown in Fig. 3 is a kind of signal just, and in this implementation, the execution sequence for step 10311 and step 10312-10313 does not do special restriction.Therefore, step 10311 and step 10312-10313 can carry out simultaneously; Or first perform step 10311, then perform step 10312-10313; Or first perform step 10312-10313, then perform step 10311.
Such as: use the Hash function 1 in step 101 and Hash function 2 to calculate subscript value code1 and subscript value code2, concrete computational process, as shown in Table 2:
Table two
According to the subscript value code1 obtained in table two and subscript value code2, character string code1_code2 can be obtained, namely character string 73347002_28255597.Use the computational methods of Hash function 1 in similar step 101 and Hash function 2, obtain subscript value code3 and subscript value code4, concrete computational process, as shown in Table 3:
Table three
In embodiments of the present invention, subscript value code3 correspondence position is any position in the front X position of the second memory bitmap, and subscript value code4 correspondence position is any position in the position in the second memory bitmap except front X position.Table two be by with MAX_INT phase and result 1273347002, and 628255597 respectively to 300,000,000 deliverys, obtain subscript value code1 and code2; Table three be by with MAX_INT phase and result 149667983, and 1049856612 respectively to 1.5 hundred million deliverys, obtain subscript value code3 and the 4th subscript probable value, afterwards the 4th subscript probable value obtained are added 1.5 hundred million, obtain subscript value code4.
A kind of method determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Wherein, the 3rd subscript value correspondence position is positioned at the front X position of the second memory bitmap, and the 4th subscript value correspondence position is arranged in the position of the second memory bitmap except front X position.Be compared to prior art, the embodiment of the present invention can by carrying out map tag to phone number in two memory bitmap, wherein, character string is carried out in the process of map tag, because the 3rd subscript value correspondence position is positioned at X position before the second memory bitmap, and the 4th subscript value correspondence position is arranged in the position of the second memory bitmap except front X position, avoid the situation that the 3rd subscript value correspondence position is identical with the 4th subscript value correspondence position, thus reduce in the second memory bitmap the probability producing key assignments conflict, determine whether phone number produces 3G surfing flow according to the key assignments of four subscript value correspondence positions afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
In another implementation of the embodiment of the present invention, can pass through the key assignments initialization of positions all in the second memory bitmap, and according to the conflict rule amendment key assignments of the 3rd subscript correspondence position and the key assignments of the 4th subscript correspondence position, thus complete the map tag process of number.Therefore, on the basis of implementation as shown in Figure 1, implementation as shown in Figure 5 can also be embodied as, wherein, described in step 102, server obtains server described in character string and step 103 according to described first subscript value and described second subscript value and obtains between the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string, step 106 can also be comprised, and the key assignments of the key assignments and described 4th subscript value correspondence position that arrange the 3rd subscript value correspondence position described in described second memory bitmap according to preset rules of server described in step 104 can be implemented as step 1041:
106, the key assignments of all positions in described second memory bitmap is initialized as 0 by described server.
1041, described server is according to described preset rules, and the key assignments of the 3rd subscript value correspondence position corresponding for the number producing described number state information and the key assignments of the 4th subscript value correspondence position are set to 1.
Phone number is as shown in Figure 4 the phone number creating 3G surfing flow, after the step 106 that is finished, 2 different hash functions are used to process phone number, obtain the first subscript value and the second subscript value, afterwards the key assignments of the first subscript value correspondence position in the first memory bitmap is set to 1, and the key assignments of the second subscript value correspondence position in the first memory bitmap is set to 1; According to the first subscript value and the second subscript value, obtain character string, 2 different hash functions are used to process character string, obtain the 3rd subscript value and the 4th subscript value, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap is set to 1, and the key assignments of the 4th subscript value correspondence position in the second memory bitmap is set to 1.
To map according to single memory bitmap respectively and two memory bitmap maps two kinds of methods, identical phone number marked and inquired about, experimental result as shown in Table 4:
Table four
From the experimental result shown in table four, can draw:
To identical 193080812 phone numbers, long 2 minutes of time shared by time shared by the method using two memory bitmap to map marks phone number marks phone number than the method using single memory bitmap to map, and the many 39MB of internal memory that the internal memory that takies of two memory bitmap takies than single memory bitmap.But, when whether inquiry mobile phone number produces 3G surfing flow, after the method using two memory bitmap to map marks phone number, the quantity of the phone number of the generation 3G surfing flow inquired is 98462056, after the method using single memory bitmap to map marks phone number, the quantity of the phone number of the generation 3G surfing flow inquired is 115320797, and the actual quantity producing the phone number of 3G surfing flow is 93806567.After marking according to above-mentioned use two kinds of methods, the quantity of the phone number of the generation 3G surfing flow inquired and the actual quantity producing the phone number of 3G surfing flow, can obtain by calculating, the method using single memory bitmap to map is marked phone number, occurs that the probability of keyword conflict is 22.93% in query script; The method using two memory bitmap to map is marked phone number, occurs that the probability of keyword conflict is 4.96% in query script.That is, the method using two memory bitmap to map is marked on the accuracy rate in query script to phone number, mark far away higher than the method using single memory bitmap to map to phone number.
A kind of method determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, to complete in initialized second memory bitmap according to preset rules afterwards, produce the key assignments of the 3rd subscript value correspondence position corresponding to the number of number state information and the key assignments of the 4th subscript value correspondence position is set to 1.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, the embodiment of the present invention can by carrying out map tag to phone number in two memory bitmap, wherein, by the key assignments of positions all in the second memory bitmap is initialized as 0, and the key assignments of the 3rd subscript value correspondence position corresponding for the phone number producing 3G surfing flow and the key assignments of the 4th subscript value correspondence position are set to 1 to complete the map tag of phone number in the second memory bitmap, be namely 0 or 1 state distinguishing phone number with the key assignments of subscript value correspondence position, determine whether phone number produces 3G surfing flow according to the key assignments of four subscript value correspondence positions afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
In another implementation of the embodiment of the present invention, character string can by generating first character of last character of the first subscript value and the second subscript value by non-numeric Connection operator.Therefore, on the basis of implementation as shown in Figure 1, step 102 can also be implemented as step 1021 as shown in Figure 6:
1021, last character of described first subscript value is connected with first character connector of described second subscript value by described server, and described connector is non-numeric character.
Server obtains the first subscript value and the second subscript value that phone number uses 2 different hash functions to calculate, and is connected by the character of the character of the first subscript value with the second subscript value.In embodiments of the present invention, can last character of the first subscript value and the second subscript first character between add non-numeric character as connector, connector can be other nonnumeric characters such as " _ ", " * ", " & ".
A kind of method determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, server is by first non-numeric Connection operator of character of last character of the first subscript value and the second subscript value, obtain character string, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, according to the key assignments of four subscript value correspondence positions, the embodiment of the present invention by carrying out map tag to phone number in two memory bitmap, can determine whether phone number produces 3G surfing flow afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
The embodiment of the present invention provides a kind of device 20 determining number state, and as shown in Figure 7, described device 20 comprises:
Acquisition module 21, for obtaining the first corresponding in the first memory bitmap subscript value of number and the second subscript value.
Generation module 22, for obtaining character string according to described first subscript value and described second subscript value.
Computing module 23, for obtaining the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string.
Module 24 is set, for the key assignments of the key assignments and described 4th subscript value correspondence position that arrange the 3rd subscript value correspondence position described in described second memory bitmap according to preset rules, described preset rules is for distinguishing the number producing number state information and the number not producing number state information.
Determination module 25, for according to the key assignments of the first subscript value correspondence position described in described first memory bitmap and the key assignments of described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
In another implementation of the embodiment of the present invention, described computing module 23, comprising:
Computing unit 231, for calculating described character string described 3rd subscript value corresponding in the second memory bitmap and described 4th subscript value by described character string by hash function.
In another implementation of the embodiment of the present invention, described 3rd subscript value correspondence position is positioned at the front X position of described second memory bitmap; Described computing unit 231, specifically for calculating described character string described 3rd subscript value corresponding in the described front X position of described second memory bitmap by described character string by the first hash function;
Described character string is calculated the 4th corresponding in described second memory bitmap subscript probable value of described character string by the second hash function, and by according to described 4th subscript probable value and described X by calculating described 4th subscript value corresponding to the position of described character string in described second memory bitmap except described front X position.
In another implementation of the embodiment of the present invention, described module 24 is set, also for the key assignments of all positions in described second memory bitmap is initialized as 0.
Described computing module 23, specifically for according to described preset rules, is set to 1 by the key assignments of the 3rd subscript value correspondence position corresponding for the number producing described number state information and the key assignments of the 4th subscript value correspondence position.
In another implementation of the embodiment of the present invention, described generation module 22, specifically for being connected with first character connector of described second subscript value by last character of described first subscript value, described connector is non-numeric character.
A kind of device determining number state that the embodiment of the present invention provides, server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value, character string is obtained according to the first subscript value and the second subscript value, and obtain the 3rd corresponding in the second memory bitmap subscript value of character string and the 4th subscript value according to character string, afterwards the key assignments of the 3rd subscript value correspondence position in the second memory bitmap and the key assignments of the 4th subscript value correspondence position are set according to preset rules.The key assignments of server according to the first subscript value correspondence position in the first memory bitmap and the key assignments of the second subscript value correspondence position, and second key assignments of the 3rd subscript value correspondence position and the key assignments of the 4th subscript value correspondence position in memory bitmap, determine the number state of number.Be compared to prior art, according to the key assignments of four subscript value correspondence positions, the embodiment of the present invention by carrying out map tag to phone number in two memory bitmap, can determine whether phone number produces 3G surfing flow afterwards.Instead of in single memory bitmap, map tag is carried out to phone number, only determine whether phone number produces 3G surfing flow according to the key assignments of two subscript value correspondence positions.Thus, improve the accuracy rate whether inquiry mobile phone number produces 3G surfing flow.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for device embodiment, because it is substantially similar to embodiment of the method, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (10)

1. determine a method for number state, it is characterized in that, described method comprises:
Server obtains the first corresponding in the first memory bitmap subscript value of number and the second subscript value;
Described server obtains character string according to described first subscript value and described second subscript value;
Described server obtains the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string;
Described server arranges the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and the key assignments of described 4th subscript value correspondence position according to preset rules, and described preset rules is for distinguishing the number producing number state information and the number not producing number state information;
Described server is according to the key assignments of the key assignments of the first subscript value correspondence position described in described first memory bitmap and described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
2. method according to claim 1, is characterized in that, described server obtains the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string, comprising:
Described character string is calculated described character string described 3rd subscript value corresponding in the second memory bitmap and described 4th subscript value by hash function by described server.
3. method according to claim 2, is characterized in that, described 3rd subscript value correspondence position is positioned at the front X position of described second memory bitmap; Described character string is calculated described character string described 3rd subscript value corresponding in the second memory bitmap and described 4th subscript value by hash function by described server, comprising:
Described character string is calculated described character string described 3rd subscript value corresponding in X position before described second memory bitmap by the first hash function by described server;
Described character string is calculated the 4th corresponding in described second memory bitmap subscript probable value of described character string by the second hash function by described server, and by described 4th subscript probable value and described X by calculating described 4th subscript value corresponding to the position of described character string in described second memory bitmap except described front X position.
4. method according to claim 1, is characterized in that, before described server obtains the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string, described method also comprises:
The key assignments of all positions in described second memory bitmap is initialized as 0 by described server;
Described server arranges the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and the key assignments of described 4th subscript value correspondence position according to preset rules, comprising:
The key assignments of the 3rd subscript value correspondence position corresponding for the number producing described number state information and the key assignments of the 4th subscript value correspondence position, according to described preset rules, are set to 1 by described server.
5. method according to claim 1, is characterized in that, described server obtains character string according to described first subscript value and described second subscript value, comprising:
Last character of described first subscript value is connected with first character connector of described second subscript value by described server, and described connector is non-numeric character.
6. determine a device for number state, it is characterized in that, described device comprises:
Acquisition module, for obtaining the first corresponding in the first memory bitmap subscript value of number and the second subscript value;
Generation module, for obtaining character string according to described first subscript value and described second subscript value;
Computing module, for obtaining the 3rd corresponding in the second memory bitmap subscript value of described character string and the 4th subscript value according to described character string;
Module is set, for the key assignments of the key assignments and described 4th subscript value correspondence position that arrange the 3rd subscript value correspondence position described in described second memory bitmap according to preset rules, described preset rules is for distinguishing the number producing number state information and the number not producing number state information;
Determination module, for according to the key assignments of the first subscript value correspondence position described in described first memory bitmap and the key assignments of described second subscript value correspondence position, and the key assignments of the key assignments of the 3rd subscript value correspondence position described in described second memory bitmap and described 4th subscript value correspondence position, determine the number state of described number.
7. device according to claim 6, is characterized in that, described computing module, comprising:
Computing unit, for calculating described character string described 3rd subscript value corresponding in the second memory bitmap and described 4th subscript value by described character string by hash function.
8. device according to claim 7, is characterized in that, described 3rd subscript value correspondence position is positioned at the front X position of described second memory bitmap; Described computing unit, specifically for calculating described character string described 3rd subscript value corresponding in X position before described second memory bitmap by described character string by the first hash function;
Described character string is calculated the 4th corresponding in described second memory bitmap subscript probable value of described character string by the second hash function, and by described 4th subscript probable value and described X by calculating described 4th subscript value corresponding to the position of described character string in described second memory bitmap except described front X position.
9. device according to claim 6, is characterized in that, describedly arranges module, also for the key assignments of all positions in described second memory bitmap is initialized as 0;
Described computing module, specifically for according to described preset rules, is set to 1 by the key assignments of the 3rd subscript value correspondence position corresponding for the number producing described number state information and the key assignments of the 4th subscript value correspondence position.
10. device according to claim 6, is characterized in that, described generation module, and specifically for being connected with first character connector of described second subscript value by last character of described first subscript value, described connector is non-numeric character.
CN201510188758.7A 2015-04-20 2015-04-20 A kind of method and device for determining number state Active CN104936210B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510188758.7A CN104936210B (en) 2015-04-20 2015-04-20 A kind of method and device for determining number state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510188758.7A CN104936210B (en) 2015-04-20 2015-04-20 A kind of method and device for determining number state

Publications (2)

Publication Number Publication Date
CN104936210A true CN104936210A (en) 2015-09-23
CN104936210B CN104936210B (en) 2018-04-10

Family

ID=54123112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510188758.7A Active CN104936210B (en) 2015-04-20 2015-04-20 A kind of method and device for determining number state

Country Status (1)

Country Link
CN (1) CN104936210B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6389123B1 (en) * 1999-11-08 2002-05-14 Lucent Technologies Inc. Decreased-size representation employed with portion of automated number identification information in determination of network control point address
CN1437374A (en) * 2003-01-20 2003-08-20 广东省电信公司科学技术研究院 Efficient separating method of long distance call area number
CN101707750A (en) * 2009-10-12 2010-05-12 南京联创科技集团股份有限公司 Flow control method based on cross operator SMS application
CN103345521A (en) * 2013-07-17 2013-10-09 腾讯科技(深圳)有限公司 Method and device for processing key values in hash table database
CN103778452A (en) * 2014-01-10 2014-05-07 惠州Tcl移动通信有限公司 Two-dimension code encoding method, two-dimension code decoding method, two-dimension code encoding system and two-dimension code decoding method based on mobile phone
CN104486777A (en) * 2014-12-01 2015-04-01 中国联合网络通信集团有限公司 Method and device for processing data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6389123B1 (en) * 1999-11-08 2002-05-14 Lucent Technologies Inc. Decreased-size representation employed with portion of automated number identification information in determination of network control point address
CN1437374A (en) * 2003-01-20 2003-08-20 广东省电信公司科学技术研究院 Efficient separating method of long distance call area number
CN101707750A (en) * 2009-10-12 2010-05-12 南京联创科技集团股份有限公司 Flow control method based on cross operator SMS application
CN103345521A (en) * 2013-07-17 2013-10-09 腾讯科技(深圳)有限公司 Method and device for processing key values in hash table database
CN103778452A (en) * 2014-01-10 2014-05-07 惠州Tcl移动通信有限公司 Two-dimension code encoding method, two-dimension code decoding method, two-dimension code encoding system and two-dimension code decoding method based on mobile phone
CN104486777A (en) * 2014-12-01 2015-04-01 中国联合网络通信集团有限公司 Method and device for processing data

Also Published As

Publication number Publication date
CN104936210B (en) 2018-04-10

Similar Documents

Publication Publication Date Title
CN105528372B (en) A kind of address search method and equipment
CN109977935A (en) A kind of text recognition method and device
CN108985934B (en) Block chain modification method and device
CN106156070B (en) A kind of querying method, file mergences method and relevant apparatus
CN103049355B (en) Method and equipment for database system recovery
CN103077208B (en) URL(uniform resource locator) matched processing method and device
CN106326309A (en) Data query method and device
CN109558525A (en) A kind of generation method of test data set, device, equipment and storage medium
CN103218555A (en) Logging-in method and device for application program
CN104809183A (en) Data reading and writing-in method and device
CN114610951A (en) Data processing method and device, electronic equipment and readable storage medium
CN106648643A (en) Method and device for generating channel package, terminal and server
CN106792699A (en) A kind of Wireless Fidelity Wi Fi connection methods and mobile terminal
CN106802958A (en) Conversion method and system of the CAD data to GIS data
CN104601645A (en) Data packet processing method and device
CN103079194B (en) Service adaptation method, apparatus and system
CN103957211B (en) Data communications method and device between client and front end page
CN103761060B (en) Data processing method and server
CN108959984A (en) Intelligent card data wiring method and device
CN104679660A (en) Embedded system debugging method and device based on symbol table
CN104936210A (en) Method of determining number state and device of determining number state
CN108241696A (en) Obtain the method, apparatus and system of map datum
CN109144853B (en) Software defined radio SoC chip debugging system
CN108259340B (en) Topology information transmission method and device
CN110362540A (en) A kind of storage of data, visitor's number acquisition methods and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant