CN103188649A - Method and device for searching attribution place of mobile phone number and service processing method - Google Patents

Method and device for searching attribution place of mobile phone number and service processing method Download PDF

Info

Publication number
CN103188649A
CN103188649A CN2011104526046A CN201110452604A CN103188649A CN 103188649 A CN103188649 A CN 103188649A CN 2011104526046 A CN2011104526046 A CN 2011104526046A CN 201110452604 A CN201110452604 A CN 201110452604A CN 103188649 A CN103188649 A CN 103188649A
Authority
CN
China
Prior art keywords
node
string
starting symbol
numeral
leaf node
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
CN2011104526046A
Other languages
Chinese (zh)
Other versions
CN103188649B (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.)
Beijing Feinno Communication Technology Co Ltd
Original Assignee
Beijing Feinno Communication Technology 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 Beijing Feinno Communication Technology Co Ltd filed Critical Beijing Feinno Communication Technology Co Ltd
Priority to CN201110452604.6A priority Critical patent/CN103188649B/en
Priority claimed from CN201110452604.6A external-priority patent/CN103188649B/en
Publication of CN103188649A publication Critical patent/CN103188649A/en
Application granted granted Critical
Publication of CN103188649B publication Critical patent/CN103188649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method and a device for searching an attribution place of a mobile phone number, and a service processing method. The method for searching the attribution place of the mobile phone number includes the following steps: a tree structure is constructed according to a number segment table in a data base and stored in an internal memory; information of each number segment in the number segment table comprises a start number, an end number and an attribution region; each node in the tree structure comprises a figure corresponding to the node, and information about whether the node is a leaf node; when the node is the leaf node, the node further comprises an attribution region corresponding to the node; when the node is not the leaf node, the node further comprises a child node collection of the node; and attribution place information corresponding to the mobile phone number is inquired through inquiry of all the nodes in the tree structure. Due to the fact that the mobile phone number is composed of 11 figures, the largest depth of the tree structure is 11. In most cases, due to the regularity of the number segments, the attribution place information of the mobile phone number can be determined just through the inquiry of 4-7 nodes, and therefore the time complexity is greatly lowered.

Description

Search method and apparatus and the method for processing business of cell-phone number ownership place
Technical field
The present invention relates to the mobile Internet field, particularly a kind of method and apparatus and a kind of method for processing business of searching the cell-phone number ownership place.
Background technology
In the mobile Internet business field, subscriber phone number is each professional core carrier data often.In concrete Business Processing, usually need to locate fast according to subscriber phone number this user's ownership place zone, just can finish follow-up processing logic based on this.Common application scenarios has:
When (1) product subscription of handling the cellphone subscriber in operation system is quit the subscription of request, need earlier to determine that according to phone number this user attaching economizes, and then belong to province BOSS to the cellphone subscriber and send the request of quitting the subscription of of ordering;
(2) lack multimedia message when issuing in the SI operation system, need to determine that according to receiving subscriber phone number information receives user attaching and economizes earlier, and then should lack multimedia message and send to and receive user attaching and economize gateway, and economize gateway by ownership and be issued to through short MMS center and receive on the user mobile phone;
(3) handle when relating to cellphone subscriber professional in operation system, need to determine according to phone number earlier this cellphone subscriber's ownership place zone, and be Rule of judgment with the ownership place zone, the concrete processing of corresponding service is routed in the corresponding internal load system, reaches the ability of fast processing magnanimity service request with this;
Generally speaking, cell-phone number Duan Yuqi ownership place zone correspondence relationship information is preset in the system, for example the cell-phone number between number section 13485740000 to 13485749999 all belongs to the Hefei City, Anhui Province, and the cell-phone number between number section 13901770000 to 13901779999 all belongs to Shanghai City.In the mobile Internet business process field, the traffic carrying capacity of processing is very big, and concurrent request is very many, and is very high to the system-through-up capability requirement, how to inquire information of home location according to cell-phone number quickly and efficiently and is only very crucial.
At present, generally all adopt direct Query Database or adopt the scheme of simple cache to realize the inquiry of cell-phone number ownership place:
Direct SQL query data-selected scheme: this scheme is the most simple and clear, by the direct area information of number section correspondence under the inquiry cell-phone number number from the database number segment table of constructing SQL statement.But in actual applications, number segment table is Dynamic Maintenance, and its data strip number may have 100,000 more than, and is very low by the mode efficient of Query Database, and frequent accessing database can cause very big pressure to the data base resource.
Simple cache scheme: be loaded in the internal memory segment information is disposable, but be to have (for example DataTable or IList) with simple prototype structure in internal memory, directly from internal memory, adopt the mode of similar Linq to inquire about during inquiry cell-phone number information of home location.This scheme is accessing database frequently, and performance promotes to some extent to a certain extent, but searches data in internal memory from hundreds of thousands bar data, and time complexity still is higher, and efficient still has limitation.
Summary of the invention
The invention provides a kind of method and apparatus and a kind of method for processing business of searching the cell-phone number ownership place, method utilization section tree structure among the present invention is realized quick search cell-phone number ownership place, carrying out related service according to the cell-phone number ownership place again handles, form because cell-phone number is 11 bit digital, the degree of depth of all tree structures is 11 to the maximum.Under most of situation, because the systematicness of number section travels through 4 to 7 nodes and can determine the cell-phone number information of home location, greatly reduce time complexity.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention discloses a kind of method of searching the cell-phone number ownership place, this method comprises:
Make up tree structure according to the number segment table in the database, and be kept in the internal memory;
Wherein, every number segment information in the described number segment table comprises initial number, finishes number and attributed region;
Each node in the described tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node;
Inquire about the information of home location of cell-phone number correspondence by each node of inquiring about in the described tree structure.
In said method, describedly make up tree structure according to the number segment table in the database and comprise:
The set of structure root node;
The traversal number segment table adds number segment information one by one in the number segment table in the tree structure of corresponding root node in the root node set.
In said method, comprise in the described tree structure that number segment information one by one in the number segment table is added to corresponding root node in the root node set: according to every number given starting symbol string of segment information, finish number string and superior node set, and judge whether is leaf node from described starting symbol string to the first numeral that finishes each number string number string; Be then to add in the superior node set as leaf node; Otherwise add in the superior node set as non-leaf node, and make up the child node set of described non-leaf node, its concrete implementation step is as follows:
A1, according to every number given starting symbol string of segment information, finish number string and superior node set;
B1, judge whether described starting symbol string and described end number string all only contains one-bit digital; Be execution in step C1 then, otherwise execution in step D1;
C1, the numeral between described starting symbol string and the described end number string is all added in the superior node set as leaf node, flow process stops;
D1, judge whether the first numeral number is gone here and there in described starting symbol string and described end identical; Be execution in step E1 then, otherwise execution in step H1;
E1, judge whether described starting symbol string since second be 0 and described end number string be 9 since the 2nd, be execution in step F1 then, otherwise execution in step G1;
F1, the first numeral of described starting symbol string is added in the superior node set as leaf node, flow process stops;
G1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, described starting symbol string and described end number string are added in the child node set of described non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
H1, judge that whether described starting symbol string is 0 except the first numeral; Be execution in step I1 then, otherwise execution in step J1;
I1, add in the superior node set the first numeral of described starting symbol string to execution in step K1 as leaf node;
J1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, number string of residue except the first place in the described starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of described new starting symbol string, add in the child node set of described non-leaf node described new starting symbol string and new end number string to execution in step K1;
K1, judging whether described end number string is 9 except the first numeral, is execution in step L1 then, otherwise execution in step M1;
The first numeral of L1, described end number string is added in the superior node set as leaf node, execution in step N1;
M1, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of the described new end number equal digital number of string, described new starting symbol string and new end number string will be added in the child node set of described non-leaf node;
N1, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
In said method, describedly inquire about the information of home location of cell-phone number correspondence and comprise by inquiring about each node in the described tree structure:
A2, the first numeral that cell-phone number is set are N, and the root node set of settings section tree structure is L;
Whether comprise the child node of N among B2, the judgement set L, if comprise then execution in step C2, this cell-phone number inquiry then is not described less than ownership place if do not comprise, the flow process termination;
C2, judge whether this node is leaf node, if leaf node is then determined the attributed region information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, execution in step D2 then;
D2, cell-phone number is set is N to the next numeral of right, the child node set that described non-node is set is L, execution in step B2.
The invention also discloses a kind of method for processing business, this method comprises:
Search the cell-phone number ownership place according to above-mentioned method;
Handle according to the mobile phone business that the cell-phone number ownership place that finds out is correlated with.
The invention also discloses a kind of device of searching the cell-phone number ownership place, this device comprises: make up module, memory modules and search module;
Described structure module is used for making up tree structure according to the number segment table of database, and is kept in the memory modules; Wherein, every number segment information in the described number segment table comprises initial number, finishes number and attributed region; Each node in the described tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node;
Described memory modules is used for preserving the tree structure that makes up module construction;
The described module of searching is used for inquiring about the information of home location of cell-phone number correspondence by each node of tree structure of inquiring about described memory modules.
In said apparatus,
Described structure module is used for making up the root node set; The traversal number segment table adds number segment information one by one in the number segment table in the tree structure of corresponding root node in the root node set;
Described structure module is used for adding in the tree structure of corresponding root node in the root node set by number segment information one by one of execution following steps with number segment table:
A1, according to every number given starting symbol string of segment information, finish number string and superior node set;
B1, judge whether described starting symbol string and described end number string all only contains one-bit digital; Be execution in step C1 then, otherwise execution in step D1;
C1, the numeral between described starting symbol string and the described end number string is all added in the superior node set as leaf node, flow process stops;
D1, judge whether the first numeral number is gone here and there in described starting symbol string and described end identical; Be execution in step E1 then, otherwise execution in step H1;
E1, judge whether described starting symbol string since second be 0 and described end number string be 9 since the 2nd, be execution in step F1 then, otherwise execution in step G1;
F1, the first numeral of described starting symbol string is added in the superior node set as leaf node, flow process stops;
G1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, described starting symbol string and described end number string are added in the child node set of described non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
H1, judge that whether described starting symbol string is 0 except the first numeral; Be execution in step I1 then, otherwise execution in step J1;
I1, add in the superior node set the first numeral of described starting symbol string to execution in step K1 as leaf node;
J1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, number string of residue except the first place in the described starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of described new starting symbol string, add in the child node set of described non-leaf node described new starting symbol string and new end number string to execution in step K1;
K1, judging whether described end number string is 9 except the first numeral, is execution in step L1 then, otherwise execution in step M1;
The first numeral of L1, described end number string is added in the superior node set as leaf node, execution in step N1;
M1, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of the described new end number equal digital number of string, described new starting symbol string and new end number string will be added in the child node set of described non-leaf node;
N1, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
In said apparatus,
The described module of searching is used for inquiring about the information of home location of cell-phone number correspondence by carrying out following steps:
A2, the first numeral that cell-phone number is set are N, and the root node set of settings section tree structure is L;
Whether comprise the child node of N among B2, the judgement set L, if comprise then execution in step C2, this cell-phone number inquiry then is not described less than ownership place if do not comprise, the flow process termination;
C2, judge whether this node is leaf node, if leaf node is then determined the attributed region information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, execution in step D2 then;
D2, cell-phone number is set is N to the next numeral of right, the child node set that described non-node is set is L, execution in step B2.
This device further comprises:
Service Processing Module is used for handling according to the mobile phone business that the information of home location of searching the cell-phone number correspondence that module inquires is correlated with.
As fully visible, in the present invention, by making up tree structure according to the number segment table in the database, and be kept in the internal memory; Wherein, every number segment information in the number segment table comprises initial number, finishes number and attributed region; Each node in the tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node; Inquire about the information of home location of cell-phone number correspondence by each node of inquiring about in the described tree structure, the mobile phone business of being correlated with according to the information of home location of the cell-phone number correspondence that inquires is handled again.Form because cell-phone number is 11 bit digital, the degree of depth of all tree structures is 11 to the maximum.Under most of situation, because the systematicness of number section travels through 4 to 7 nodes and can determine the cell-phone number information of home location, greatly reduce time complexity.
Description of drawings
Fig. 1 is the method flow diagram of searching the cell-phone number ownership place in the embodiment of the invention;
Fig. 2 is the flow chart that makes up tree structure in the embodiment of the invention;
Fig. 3 is the flow chart of inquiring about the ownership place algorithm in the embodiment of the invention according to cell-phone number;
Fig. 4 is the schematic diagram of the tree structure that makes up in the embodiment of the invention;
Fig. 5 is the apparatus structure schematic diagram of searching the cell-phone number ownership place in the embodiment of the invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
In database, number segment information of system's Dynamic Maintenance comprises following field: initial number, end number, attributed region (what preserve in the real system is attributed region ID value).
Fig. 1 is the method flow diagram of searching the cell-phone number ownership place in the embodiment of the invention, and as shown in Figure 1, this method may further comprise the steps:
101, make up tree structure according to the number segment table in the database, and be kept in the internal memory.
Wherein, every number segment information in this number segment table comprises initial number, finishes number and attributed region;
Each node in this tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node.
102, inquire about the information of home location of cell-phone number correspondence by each node of inquiring about in the described tree structure.
In a preferred embodiments, each node of the tree structure Tree that can make up according to the number segment table in the database is all corresponding with certain the one-bit digital information in the cell-phone number, from root node, and from left to right 11 numerals in the corresponding cell-phone number from top to bottom.
A kind of method for processing business among the present invention is: the mobile phone business that the information of home location of the cell-phone number correspondence that inquires according to method shown in Figure 1 is correlated with is handled.
Relevant mobile phone business described here is for carrying out the business of relevant treatment according to the information of home location of cell-phone number.For example: when the product subscription that (1) handles the cellphone subscriber in operation system is quit the subscription of request, need earlier to determine that according to phone number this user attaching economizes, and then belong to province BOSS to the cellphone subscriber and send the request of quitting the subscription of of ordering; (2) lack multimedia message when issuing in the SI operation system, need to determine that according to receiving subscriber phone number information receives user attaching and economizes earlier, and then should lack multimedia message and send to and receive user attaching and economize gateway, and economize gateway by ownership and be issued to through short MMS center and receive on the user mobile phone; (3) handle when relating to cellphone subscriber professional in operation system, need to determine according to phone number earlier this cellphone subscriber's ownership place zone, and be Rule of judgment with the ownership place zone, the concrete processing of corresponding service is routed in the corresponding internal load system, reaches the ability of fast processing magnanimity service request with this.
For realizing the above-mentioned structure tree structure of searching in the cell-phone number ownership place method, at first, make up the root node set; Travel through number segment table then, number segment information one by one in the number segment table is added in the tree structure of corresponding root node in the root node set.In actual the use since cell-phone number all with numeral " 1 " beginning, so generally have only the node of a corresponding numeral " 1 " in the root node set.
Number segment information one by one in the number segment table is added in the tree structure of corresponding root node in the root node set and comprise: according to every number given starting symbol string of segment information, finish number string and superior node set, and judge whether is leaf node from described starting symbol string to the first numeral that finishes each number string number string; Be then to add in the superior node set as leaf node; Otherwise add in the superior node set as non-leaf node, and make up the child node set of described non-leaf node.Specifically as shown in Figure 2.
Fig. 2 is the flow chart that makes up tree structure in the embodiment of the invention, and as shown in Figure 2, step is as follows:
201, according to every number given starting symbol string of segment information, end number string and superior node set;
202, judge whether described starting symbol string and described end number string all only contains one-bit digital; Be execution in step 203 then, otherwise execution in step 204;
203, the numeral between described starting symbol string and the described end number string is all added in the superior node set as leaf node, flow process stops;
204, judge whether the first numeral number is gone here and there in described starting symbol string and described end identical; Be execution in step 205 then, otherwise execution in step 208;
205, judge whether described starting symbol string since second be 0 and described end number string be 9 since the 2nd, be execution in step 206 then, otherwise execution in step 207;
206, the first numeral of described starting symbol string is added in the superior node set as leaf node, flow process stops;
207, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, described starting symbol string and described end number string are added in the child node set of described non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
208, judge whether the starting symbol string is 0 except the first numeral; Be execution in step 209 then, otherwise execution in step 210;
209, the first numeral of starting symbol string is added in the superior node set to execution in step K1 as leaf node;
210, the first numeral of starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, number string of residue except the first place in the starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of described new starting symbol string, add in the child node set of described non-leaf node described new starting symbol string and new end number string to execution in step 211;
212, judge finishing number string and whether be 9 except the first numeral, is execution in step 213 then, otherwise execution in step 214;
213, finish the first numeral of number string and add in the superior node set execution in step 215 as leaf node to;
214, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of the described new end number equal digital number of string, described new starting symbol string and new end number string will be added in the child node set of described non-leaf node;
215, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
By inquiring about each node in the tree structure that builds according to said method, can inquire about the information of home location of cell-phone number correspondence, Fig. 3 is the flow chart of inquiring about the ownership place algorithm in the embodiment of the invention according to cell-phone number, as shown in Figure 3, specifically comprises:
301, the first digital N of being of cell-phone number is set, and the root node set of setting segment number section is L;
302, judge among the set L whether comprise the child node of corresponding digital N, if comprise then execution in step 303, this cell-phone number inquiry then is not described less than ownership place if do not comprise, flow process stops;
303, judge whether this node is leaf node, if leaf node is then determined the area information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, then execution in step 304;
304, cell-phone number is set to the next digital N of being of right, the child node set that described non-leaf is set is L, execution in step 302.
Existing following table data are that sample data is elaborated:
Initial number Finish number Attributed region
13651600000 13651999999 Shanghai
13652000000 13652199999 Tianjin
13652200000 13653099999 Guangdong
Table 1 number segment table sample data
Fig. 4 is the schematic diagram of the tree structure that makes up in the embodiment of the invention, and tree structure is as can be seen from Fig. 4:
The numeral of ground floor root node correspondence is " 1 ", and this node is non-leaf node, and a child node " 3 " is only arranged;
The corresponding node of second layer numeral " 3 " and the 3rd layer digital " 6 " also is non-leaf node, and a leaf node " 6 " and " 5 " are all only arranged;
The corresponding node of the 4th layer digital " 5 " is non-leaf node, comprises two nodes in the child node set: numeral " 1 " and the corresponding node of numeral " 2 ";
Layer 5 numeral " 1 " is non-leaf node, comprises 4 nodes in the child node set: numeral " 6 ", " 7 ", " 8 " and " 9 " corresponding node, and these 4 sub-leaf nodes all belong to sea region.
In the time need from this tree structure, searching regional that cell-phone number 13651823089 belongs to, according to following logic one query tree node:
1) first bit digital " 1 " of the cell-phone number numeral " 1 " corresponding with root node in the tree structure is complementary, and then searches from the child node set (numeral " 3 ") of this node again;
2) node " 3 " of the second-order digit of cell-phone number " 3 " in the child node that previous step inquires is combined is complementary, and then searches from the child node set (numeral " 6 ") of this node again;
3) node " 6 " of the 3rd bit digital " 6 " of cell-phone number in the child node that previous step inquires is combined is complementary, and then searches from the child node set (numeral " 5 ") of this node again;
4) node " 5 " of the 4-digit number " 5 " of cell-phone number in the child node that previous step inquires is combined is complementary, and then searches from the child node set (numeral " 1 " and " 2 ") of this node again;
5) node " 1 " of the five digit number " 1 " of cell-phone number in the child node that previous step inquires is combined is complementary, and then searches from the child node set (numeral " 6 ", " 7 ", " 8 " and " 9 ") of this node again;
6) node " 8 " of the 6th bit digital " 8 " of cell-phone number in the child node that previous step inquires is combined is complementary, and the corresponding node of numeral " 8 " is leaf node, the zone of this node correspondence is " Shanghai ", so far inquire the ownership place of cell-phone number 13651823089, namely belonged to Shanghai.
Fig. 5 is the apparatus structure schematic diagram of searching the cell-phone number ownership place in the embodiment of the invention, and as shown in Figure 5, this device comprises: make up module 501, memory modules 502, search module 503 and Service Processing Module 504;
Make up module 501, be used for making up tree structure according to the number segment table of database, and be kept in the memory modules 502; Wherein, every number segment information in the number segment table comprises initial number, finishes number and attributed region; Each node in the tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node;
Memory modules 502 is used for preserving the tree structure that makes up module construction;
Search module 503, be used for inquiring about the information of home location of cell-phone number correspondence by each node of tree structure of audit memory module 502;
Service Processing Module 504 is used for handling according to the mobile phone business that the information of home location of searching the cell-phone number correspondence that module 503 inquires is correlated with.
Make up module 501, be used for making up the root node set; The traversal number segment table adds number segment information one by one in the number segment table in the tree structure of corresponding root node in the root node set.
Described structure module 201 is used for according to every number given starting symbol string of segment information, finishes number string and superior node set, and judges whether is leaf node from described starting symbol string to the first numeral that finishes each number string number string; Be then to add in the superior node set as leaf node; Otherwise add in the superior node set as non-leaf node, and make up the child node set of described non-leaf node.
Specifically, making up module 501 is used for adding in the tree structure of corresponding root node in the root node set by number segment information one by one of execution following steps with number segment table:
A1, according to every number given starting symbol string of segment information, finish number string and superior node set;
B1, judge this starting symbol string and finish number string whether all only contain one-bit digital; Be execution in step C1 then, otherwise execution in step D1;
C1, this starting symbol string and the numeral that finishes between number string are all added in the superior node set as leaf node, flow process stops;
D1, judge whether the first numeral number is gone here and there in this starting symbol string and this end identical; Be execution in step E1 then, otherwise execution in step H1;
E1, judge whether this starting symbol string since second be 0 and this end number string be 9 since the 2nd, be execution in step F1 then, otherwise execution in step G1;
F1, the first numeral of this starting symbol string is added in the superior node set as leaf node, flow process stops;
G1, the first numeral of this starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up this non-leaf node is gathered, this starting symbol string and this end number string are added in the child node set of this non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
H1, judge that whether this starting symbol string is 0 except the first numeral; Be execution in step I1 then, otherwise execution in step J1;
I1, add in the superior node set the first numeral of this starting symbol string to execution in step K1 as leaf node;
J1, the first numeral of this starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up this non-leaf node is gathered, number string of residue except the first place in this starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of this new starting symbol string, add in the child node set of this non-leaf node this new starting symbol string and new end number string to execution in step K1;
K1, judging whether this end number string is 9 except the first numeral, is execution in step L1 then, otherwise execution in step M1;
The first numeral of L1, this end number string is added in the superior node set as leaf node, execution in step N1;
M1, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up this non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of this new end number equal digital number of string, this new starting symbol string and new end number string will be added in the child node set of this non-leaf node;
N1, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
Search module 503, be used for inquiring about the information of home location of cell-phone number correspondence by carrying out following steps:
A2, the first numeral that cell-phone number is set are N, and the root node set of settings section tree structure is L;
Whether comprise the child node of N among B2, the judgement set L, if comprise then execution in step C2, this cell-phone number inquiry then is not described less than ownership place if do not comprise, the flow process termination;
C2, judge whether this node is leaf node, if leaf node is then determined the attributed region information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, execution in step D2 then;
D2, cell-phone number is set is N to the next numeral of right, the child node set that this non-node is set is L, execution in step B2.
In sum, in the present invention, by making up tree structure according to the number segment table in the database, and be kept in the internal memory; Wherein, every number segment information in the number segment table comprises initial number, finishes number and attributed region; Each node in the tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node; Inquire about the information of home location of cell-phone number correspondence by each node of inquiring about in the described tree structure, again the Business Processing of being correlated with according to the corresponding information of home location of the cell-phone number that inquires.Form because cell-phone number is 11 bit digital, the degree of depth of all tree structures is 11 to the maximum.Under most of situation, because the systematicness of number section travels through 4 to 7 nodes and can determine the cell-phone number information of home location, greatly reduce time complexity.
The above is preferred embodiment of the present invention only, is not for limiting protection scope of the present invention.All any modifications of doing within the spirit and principles in the present invention, be equal to replacement, improvement etc., all be included in protection scope of the present invention.

Claims (10)

1. a method of searching the cell-phone number ownership place is characterized in that, this method comprises:
Make up tree structure according to the number segment table in the database, and be kept in the internal memory;
Wherein, every number segment information in the described number segment table comprises initial number, finishes number and attributed region;
Each node in the described tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node;
Inquire about the information of home location of cell-phone number correspondence by each node of inquiring about in the described tree structure.
2. method according to claim 1 is characterized in that, describedly makes up tree structure according to the number segment table in the database and comprises:
The set of structure root node;
The traversal number segment table adds number segment information one by one in the number segment table in the tree structure of corresponding root node in the root node set.
3. method according to claim 2 is characterized in that, comprises in the described tree structure that number segment information one by one in the number segment table is added to corresponding root node in the root node set:
According to every number given starting symbol string of segment information, finish number string and superior node set, and judge whether is leaf node from described starting symbol string to the first numeral that finishes each number string number string; Be then to add in the superior node set as leaf node; Otherwise add in the superior node set as non-leaf node, and make up the child node set of described non-leaf node.
4. method according to claim 3, it is characterized in that, described according to every number given starting symbol string of segment information, finish number string and superior node set, and judge whether is leaf node from described starting symbol string to the first numeral that finishes each number string number string; Be then to add in the superior node set as leaf node; Otherwise add in the superior node set as non-leaf node, and the child node set that makes up described non-leaf node comprises:
A1, according to every number given starting symbol string of segment information, finish number string and superior node set;
B1, judge whether described starting symbol string and described end number string all only contains one-bit digital; Be execution in step C1 then, otherwise execution in step D1;
C1, the numeral between described starting symbol string and the described end number string is all added in the superior node set as leaf node, flow process stops;
D1, judge whether the first numeral number is gone here and there in described starting symbol string and described end identical; Be execution in step E1 then, otherwise execution in step H1;
E1, judge whether described starting symbol string since second be 0 and described end number string be 9 since the 2nd, be execution in step F1 then, otherwise execution in step G1;
F1, the first numeral of described starting symbol string is added in the superior node set as leaf node, flow process stops;
G1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, described starting symbol string and described end number string are added in the child node set of described non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
H1, judge that whether described starting symbol string is 0 except the first numeral; Be execution in step I1 then, otherwise execution in step J1;
I1, add in the superior node set the first numeral of described starting symbol string to execution in step K1 as leaf node;
J1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, number string of residue except the first place in the described starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of described new starting symbol string, add in the child node set of described non-leaf node described new starting symbol string and new end number string to execution in step K1;
K1, judging whether described end number string is 9 except the first numeral, is execution in step L1 then, otherwise execution in step M1;
The first numeral of L1, described end number string is added in the superior node set as leaf node, execution in step N1;
M1, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of the described new end number equal digital number of string, described new starting symbol string and new end number string will be added in the child node set of described non-leaf node;
N1, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
5. method according to claim 1 is characterized in that, describedly inquires about the information of home location of cell-phone number correspondence and comprises by inquiring about each node in the described tree structure:
A2, the first numeral that cell-phone number is set are N, and the root node set of settings section tree structure is L;
Whether comprise the child node of N among B2, the judgement set L, if comprise then execution in step C2, this cell-phone number inquiry then is not described less than ownership place if do not comprise, the flow process termination;
C2, judge whether this node is leaf node, if leaf node is then determined the attributed region information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, execution in step D2 then;
D2, cell-phone number is set is N to the next numeral of right, the child node set that described non-leaf node is set is L, execution in step B2.
6. a method for processing business is characterized in that, this method comprises:
Search the cell-phone number ownership place according to each described method in the claim 1 to 5;
Handle according to the mobile phone business that the cell-phone number ownership place that finds out is correlated with.
7. a device of searching the cell-phone number ownership place is characterized in that, this device comprises: make up module, memory modules, search module and Service Processing Module;
Described structure module is used for making up tree structure according to the number segment table of database, and is kept in the memory modules; Wherein, every number segment information in the described number segment table comprises initial number, finishes number and attributed region; Each node in the described tree structure includes: whether the numeral of node correspondence, this node are leaf node; When this node is leaf node, also comprise: the attributed region of this node correspondence; When this node is non-leaf node, also comprise: the child node set of this node;
Described memory modules is used for preserving the tree structure that makes up module construction;
The described module of searching is used for inquiring about the information of home location of cell-phone number correspondence by each node of tree structure of inquiring about described memory modules.
8. device according to claim 7 is characterized in that,
Described structure module is used for making up the root node set; The traversal number segment table adds number segment information one by one in the number segment table in the tree structure of corresponding root node in the root node set;
Described structure module is used for adding in the tree structure of corresponding root node in the root node set by number segment information one by one of execution following steps with number segment table:
A1, according to every number given starting symbol string of segment information, finish number string and superior node set;
B1, judge whether described starting symbol string and described end number string all only contains one-bit digital; Be execution in step C1 then, otherwise execution in step D1;
C1, the numeral between described starting symbol string and the described end number string is all added in the superior node set as leaf node, flow process stops;
D1, judge whether the first numeral number is gone here and there in described starting symbol string and described end identical; Be execution in step E1 then, otherwise execution in step H1;
E1, judge whether described starting symbol string since second be 0 and described end number string be 9 since the 2nd, be execution in step F1 then, otherwise execution in step G1;
F1, the first numeral of described starting symbol string is added in the superior node set as leaf node, flow process stops;
G1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, described starting symbol string and described end number string are added in the child node set of described non-leaf node since the 2nd the new starting symbol string of forming and new end number string, and flow process stops;
H1, judge that whether described starting symbol string is 0 except the first numeral; Be execution in step I1 then, otherwise execution in step J1;
I1, add in the superior node set the first numeral of described starting symbol string to execution in step K1 as leaf node;
J1, the first numeral of described starting symbol string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, number string of residue except the first place in the described starting symbol string is formed new starting symbol string, to form the new number string that finishes with " 9 " of the equal digital number of described new starting symbol string, add in the child node set of described non-leaf node described new starting symbol string and new end number string to execution in step K1;
K1, judging whether described end number string is 9 except the first numeral, is execution in step L1 then, otherwise execution in step M1;
The first numeral of L1, described end number string is added in the superior node set as leaf node, execution in step N1;
M1, the first numeral of end number string is added in the superior node set as non-leaf node, and the child node that makes up described non-leaf node is gathered, the new number string that finishes of residue except the first place number string composition in number string will be finished, to form new starting symbol string with " 0 " of the described new end number equal digital number of string, described new starting symbol string and new end number string will be added in the child node set of described non-leaf node;
N1, the first numeral of starting symbol string and the numeral that finishes in the middle of the first numeral of number string are added in the superior node set as leaf node.
9. device according to claim 8 is characterized in that,
The described module of searching is used for inquiring about the information of home location of cell-phone number correspondence by carrying out following steps:
A2, the first numeral that cell-phone number is set are N, and the root node set of settings section tree structure is L;
Whether comprise the child node of N among B2, the judgement set L, if comprise then execution in step C2, this cell-phone number inquiry then is not described less than ownership place if do not comprise, the flow process termination;
C2, judge whether this node is leaf node, if leaf node is then determined the attributed region information of ownership place for comprising in this leaf node of this cell-phone number correspondence, inquiry finishes; If this node is non-leaf node, execution in step D2 then;
D2, cell-phone number is set is N to the next numeral of right, the child node set that described non-node is set is L, execution in step B2.
10. according to each described device in the claim 7 to 9, it is characterized in that this device further comprises:
Service Processing Module is used for handling according to the mobile phone business that the information of home location of searching the cell-phone number correspondence that module inquires is correlated with.
CN201110452604.6A 2011-12-29 Search method and apparatus and the method for processing business of cell-phone number ownership place Active CN103188649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110452604.6A CN103188649B (en) 2011-12-29 Search method and apparatus and the method for processing business of cell-phone number ownership place

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110452604.6A CN103188649B (en) 2011-12-29 Search method and apparatus and the method for processing business of cell-phone number ownership place

Publications (2)

Publication Number Publication Date
CN103188649A true CN103188649A (en) 2013-07-03
CN103188649B CN103188649B (en) 2016-12-14

Family

ID=

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866536A (en) * 2015-04-29 2015-08-26 联动优势科技有限公司 Compression method and device of number segment records
CN104866535A (en) * 2015-04-29 2015-08-26 联动优势科技有限公司 Compression method and device of number segment records
CN108197124A (en) * 2016-12-08 2018-06-22 北京京东尚科信息技术有限公司 The method, apparatus and system for publishing nss message are mapped according to ISBN prefixes
CN115883508A (en) * 2021-09-26 2023-03-31 中移物联网有限公司 Number processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035307A (en) * 2007-03-05 2007-09-12 北京佳讯飞鸿电气有限责任公司 Implementation method for fuzzy number analysis in the switcher
CN101039287A (en) * 2007-03-15 2007-09-19 中兴通讯股份有限公司 Number receiving method for accessing gateway equipment
CN101656953A (en) * 2009-09-21 2010-02-24 中兴通讯股份有限公司 Number matching method and device
CN103020060A (en) * 2011-09-20 2013-04-03 佳都新太科技股份有限公司 Number segment matching algorithm based on tree structure and realization method of number segment matching algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035307A (en) * 2007-03-05 2007-09-12 北京佳讯飞鸿电气有限责任公司 Implementation method for fuzzy number analysis in the switcher
CN101039287A (en) * 2007-03-15 2007-09-19 中兴通讯股份有限公司 Number receiving method for accessing gateway equipment
CN101656953A (en) * 2009-09-21 2010-02-24 中兴通讯股份有限公司 Number matching method and device
CN103020060A (en) * 2011-09-20 2013-04-03 佳都新太科技股份有限公司 Number segment matching algorithm based on tree structure and realization method of number segment matching algorithm

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866536A (en) * 2015-04-29 2015-08-26 联动优势科技有限公司 Compression method and device of number segment records
CN104866535A (en) * 2015-04-29 2015-08-26 联动优势科技有限公司 Compression method and device of number segment records
CN108197124A (en) * 2016-12-08 2018-06-22 北京京东尚科信息技术有限公司 The method, apparatus and system for publishing nss message are mapped according to ISBN prefixes
CN115883508A (en) * 2021-09-26 2023-03-31 中移物联网有限公司 Number processing method and device, electronic equipment and storage medium
CN115883508B (en) * 2021-09-26 2024-06-07 中移物联网有限公司 Number processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN103345521B (en) A kind of method and apparatus processing key assignments in Hash table database
CN101640613B (en) Method and device for network resource relating management
CN102906751A (en) Method and device for data storage and data query
CN101478608A (en) Fast operating method for mass data based on two-dimensional hash
CN101916288B (en) Mobile communication user search request responding system and processing method thereof
Xiao et al. Using parallel bloom filters for multiattribute representation on network services
CN110781184A (en) Data table construction method, device, equipment and storage medium
CN102567505A (en) Distributed database and data manipulation method
CN101000677A (en) Matching method and system of marketing business recommended
CN104268298A (en) Method for creating database index and inquiring data
CN103116641B (en) Obtain method and the collator of the statistics of sequence
CN103425694B (en) The searching method of relational data and device
CN101420681A (en) A kind of Business Management Platform is handled the method and apparatus that request is by all kinds of means ordered down
CN101217690A (en) A system and method for realizing distributed storage of data operation and data information
CN105653654A (en) Lucky draw qualification indexing system and method
CN102103606A (en) Technology for realizing advanced search of commodities on mobile phone client
CN107277095B (en) Session segmentation method and device
CN102214214B (en) Method and device for processing data relationship and mobile communication terminal
CN103188649A (en) Method and device for searching attribution place of mobile phone number and service processing method
CN1967528A (en) Data matching inquiry method based on key words
CN1848737A (en) Charging method
CN103188649B (en) Search method and apparatus and the method for processing business of cell-phone number ownership place
CN102419746A (en) Three-dimensional search system and three-dimensional search method
CN108399233A (en) A kind of enquiring and optimizing method of the distributed data base based on algorithm
CN105357105B (en) A kind of device and method promoting session speed

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: Room 810, 8 / F, 34 Haidian Street, Haidian District, Beijing 100080

Patentee after: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 100089 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building 6 storey block A room 602

Patentee before: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd.