Invention content
In view of this, the present invention provides a kind of storage of information of home location, acquisition methods and devices, to overcome the prior art
In due to by number segment resource storage in the database, so extend search ownership place time the problem of.
To achieve the above object, the present invention provides the following technical solutions:
A kind of information of home location storage method, including:
The first field is obtained from number, first field includes the number for the information of home location for identifying the number;
Obtain the quotient and the remainder of first field divided by parameter preset;
The information of home location of the number is stored to the first storage region of memory space, first storage region
Initial address is that physical block address is the quotient, and offset address is the remainder, and the byte length of first storage region is
Preset length.
Wherein, first field is the number section of the number or the number is phone number, and first field is
Second in the number section is to the 7th bit digital.
Wherein, the parameter preset is N/M, and the M is the byte length of the minimum memory unit of the memory space
Factor, the N are the positive integer more than or equal to 1, and the method for obtaining the preset length includes:
The product of N/M and the byte length of the minimum memory unit of the memory space are calculated, the product is described pre-
If length.
A kind of information of home location acquisition methods, including:
The first field is obtained from number, first field includes the number for the information of home location for identifying the number;
Obtain the quotient and the remainder of first field divided by parameter preset;
The first storage region is determined from the memory space, the initial address of first storage region is physical block
Address is the quotient, and offset address is the remainder, and the byte length of first storage region is preset length;
The information of home location of the number is obtained from first storage region.
Wherein, the information of home location includes ownership place number information, and the information of home location storage method further includes:
According to the correspondence of pre-set ownership place number information and ownership place, the ownership place number information is obtained
Corresponding ownership place.
A kind of information of home location storage device, including:
First acquisition module, for obtaining the first field from number, first field includes the mark number
The number of information of home location;
Second acquisition module, the quotient and the remainder for obtaining first field divided by parameter preset;;
Memory module, it is described for storing the information of home location of the number to the first storage region of memory space
The initial address of first storage region is that physical block address is the quotient, and offset address is the remainder, first memory block
The byte length in domain is preset length.
Wherein, first field is the number section of the number or the number is phone number, and first field is
Second in the number section is to the 7th bit digital.
Wherein, the parameter preset is N/M, and the M is the byte length of the minimum memory unit of the memory space
Factor, the N are the positive integer more than or equal to 1, and the information of home location storage device further includes:
Computing module, the product for calculating N/M and the byte length of the minimum memory unit of the memory space are described
Product is the preset length.
A kind of information of home location acquisition device, including:
First acquisition module, for obtaining the first field from number, first field includes the mark number
The number of information of home location;
Second acquisition module, the quotient and the remainder for obtaining first field divided by parameter preset;
Determining module, for determining that the first storage region, first storage region rise from the memory space
Beginning address is that physical block address is the quotient, and offset address is the remainder, and the byte length of first storage region is pre-
If length;
Third acquisition module, the information of home location for obtaining the number from first storage region.
Wherein, further include:
4th acquisition module is obtained for the correspondence according to pre-set ownership place number information and ownership place
The corresponding ownership place of the ownership place number information.
It can be seen via above technical scheme that compared with prior art, an embodiment of the present invention provides a kind of ownership place letters
Storage method is ceased, the information of home location of number is stored in memory space in this method, and stores the first of information of home location
The initial address of storage region can be obtained by the quotient and the remainder of the first field and parameter preset in number, the first memory block
The initial address in domain is that physical block address is above-mentioned quotient, and offset address is above-mentioned remainder, and the byte length of the first storage region is
Preset length, to be provided a convenient to search information of home location, for example, when the information of home location for requiring to look up a certain number
When, the physical address of information of home location can be directly calculated according to the first field and parameter preset, and know the information of home location
Byte length be preset length, it is possible to the information of home location of the number is directly obtained from the first storage region, to
Time to save the ownership place for searching number provides foundation.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Attached drawing 1 is please referred to, it, should for an embodiment of the present invention provides a kind of flow diagrams of information of home location storage method
Method includes:
Step S101:The first field is obtained from number.
First field includes the number for the information of home location for identifying above-mentioned number.
First field can be all numbers of number, or the number section in number, such as number section 1358555(It is right
For cell-phone number), number section 0312(For home Tel).
Assuming that above-mentioned number is 15033745663, then the first field can be 15033745663(Entire number), also may be used
It is 1503374(Number section)Or 15033745 or 150337456 or 1503374566.
Since first of cell-phone number in the prior art is all 1, the data for really carrying information of home location are next 6
Position, so can be identified for that the number of the information of home location of number can be 503374, i.e. the first field can be the in number section
Two to the 7th bit digital.Above-mentioned first field can also be 5033745 etc., and the embodiment of the present invention is not to the first field
Particular content is construed as limiting, as long as the number of the information of home location including can be identified for that above-mentioned number.
Step S102:Obtain the quotient and the remainder of the first field divided by parameter preset.
Step S103:The information of home location of above-mentioned number is stored to the first storage region of memory space.
The initial address of first storage region is that physical block address is the quotient, and offset address is the remainder, and first deposits
The byte length in storage area domain is preset length.
Assuming that above-mentioned number is cell-phone number, the number section of the cell-phone number is 1503328, and the first field is 503328, this is default
Parameter is 3/2, then the physical block address of the corresponding information of home location of the cell-phone number is 754992, offset address 0.
Information of home location can be Chinese character title, phonetic title or the number of ownership place.
An embodiment of the present invention provides a kind of information of home location storage method, the information of home location of number is deposited in this method
Storage is in memory space, and the initial address for storing the first storage region of information of home location can pass through the first word in number
Section and the quotient and the remainder of parameter preset obtain, and it is above-mentioned quotient that the initial address of the first storage region, which is physical block address, offset ground
Location is above-mentioned remainder, and the byte length of the first storage region is preset length, to be provided a convenient to search information of home location,
For example, when requiring to look up the information of home location of a certain number, it can directly be calculated and be returned with parameter preset according to the first field
The physical address of possession information, and know that the byte length of the information of home location is preset length, it is possible to from the first memory block
The information of home location of the number is directly obtained in domain, to which the time of the ownership place to save lookup number provides foundation.
Parameter preset in above-mentioned information of home location storage method embodiment can be N/M, and M is that the minimum of memory space is deposited
The factor of the byte length of storage unit, N are the positive integer more than or equal to 1, a kind of information of home location provided in an embodiment of the present invention
The method of acquisition preset length in storage method includes:Calculate the byte length of the minimum memory unit of N/M and memory space
Product, the product be preset length.
Such as when the byte length of the minimum memory unit of memory space is 8, then M can be 2,4 or 8.Parameter preset can
Think 3/2,9/8 etc., it is assumed that the byte length of parameter preset 3/2, the minimum memory unit of memory space is 8, then presets
Length is 12 bytes.
It is understood that memory space is limited, if the Chinese character of ownership place or phonetic transcriptions of Chinese characters are stored directly in
Many bytes may be occupied in first storage region, can be that each ownership place setting one is compiled to save memory space
Number, which is stored in the first storage region.
Assuming that all ownership place in the prior art probably have more than 400, can return successively to each since number 1
Possession is numbered, wherein 0 is expressed as sky ownership place, i.e., is not present without the ownership place namely the number.It is above-mentioned to ownership
The method that ground is numbered is an example provided in an embodiment of the present invention, and how the embodiment of the present invention is to not to be ownership place
The method being numbered is defined.
The byte length of the minimum memory unit of memory space can be 8, be 255 since 1 byte maximum preserves numerical value,
And the number of all ownership place is 400 or so, so 9 bit are needed, so the minimum value of N/M can be 9/8, certainly
N/M may be 3/2, and the embodiment of the present invention is not defined the occurrence of parameter preset.
Referring to Fig. 2, being a kind of flow diagram of information of home location acquisition methods provided in an embodiment of the present invention, the party
Method includes:
Step S201:The first field from number.
First field includes the number for the information of home location for identifying above-mentioned number.
First field can be all numbers of number, or the number section in number, such as number section 1358555(It is right
For cell-phone number), number section 0312(For home Tel).
Assuming that above-mentioned number is 15033745663, then the first field can be 15033745663(Entire number), also may be used
It is 1503374(Number section)Or 15033745 or 150337456 or 1503374566.
Since first of cell-phone number in the prior art is all 1, the data for really carrying information of home location are next 6
Position, so can be identified for that the number of the information of home location of number can be 503374, i.e. the first field can be the in number section
Two to the 7th bit digital.Above-mentioned first field can also be 5033745 etc., and the embodiment of the present invention is not to the first field
Particular content is construed as limiting, as long as the number of the information of home location including can be identified for that above-mentioned number.
Step S202:Obtain the quotient and the remainder of the first field divided by parameter preset.
Step S203:The first storage region is determined from memory space.
It is the quotient that the initial address of first storage region, which is physical block address, and offset address is the remainder, described the
The byte length of one storage region is preset length.
Assuming that above-mentioned number is cell-phone number, the number section of the cell-phone number is 1503328, and the first field is 503328, this is default
Parameter is 3/2, then the physical block address of the corresponding information of home location of the cell-phone number is 754992, offset address 0.
Step S204:The information of home location of above-mentioned number is obtained from the first storage region.
Information of home location can be Chinese character title, phonetic title or the number of ownership place.
Information of home location acquisition methods provided in an embodiment of the present invention, when the information of home location for requiring to look up a certain number
When, the physical address of information of home location can be directly calculated according to the first field and parameter preset, and know the information of home location
Byte length be preset length, it is possible to the information of home location of the number is directly obtained from the first storage region, to
Save the time for the ownership place for searching number.
It is understood that memory space is limited, if the Chinese character of ownership place or phonetic transcriptions of Chinese characters are stored directly in
Many bytes may be occupied in first storage region, can be that each ownership place setting one is compiled to save memory space
Number, which is stored in the first storage region, then obtains corresponding ownership place further according to the number.Above-mentioned ownership place letter
Breath includes ownership place number information, which further includes:According to pre-set ownership place number information
With the correspondence of ownership place, the corresponding ownership place of ownership place number information is obtained.
Assuming that all ownership place in the prior art probably have more than 400, can return successively to each since number 1
Possession is numbered, wherein 0 is expressed as sky ownership place, i.e., is not present without the ownership place namely the number.It is above-mentioned to ownership
The method that ground is numbered is an example provided in an embodiment of the present invention, and how the embodiment of the present invention is to not to be ownership place
The method being numbered is defined.
The byte length of the minimum memory unit of memory space can be 8, be 255 since 1 byte maximum preserves numerical value,
And the number of all ownership place is 400 or so, so 9 bit are needed, so the minimum value of N/M can be 9/8, certainly
N/M may be 3/2, and the embodiment of the present invention is not defined the occurrence of parameter preset.
Method is described in detail in aforementioned present invention disclosed embodiment, diversified forms can be used for the method for the present invention
Device realize that therefore the invention also discloses a variety of devices, and specific embodiment is given below and is described in detail.
Referring to Fig. 3, being a kind of structural schematic diagram of information of home location storage device provided in an embodiment of the present invention, the dress
Set including:First acquisition module 301, the second acquisition module 302 and memory module 303, wherein:
First acquisition module 301, for obtaining the first field from number.
First field includes the number for the information of home location for identifying above-mentioned number.
First field can be all numbers of number, or the number section in number, such as number section 1358555(It is right
For cell-phone number), number section 0312(For home Tel).
Assuming that above-mentioned number is 15033745663, then the first field can be 15033745663(Entire number), also may be used
It is 1503374(Number section)Or 15033745 or 150337456 or 1503374566.
Since first of cell-phone number in the prior art is all 1, the data for really carrying information of home location are next 6
Position, so can be identified for that the number of the information of home location of number can be 503374, i.e. the first field can be the in number section
Two to the 7th bit digital.Above-mentioned first field can also be 5033745 etc., and the embodiment of the present invention is not to the first field
Particular content is construed as limiting, as long as the number of the information of home location including can be identified for that above-mentioned number.
Second acquisition module 302, the quotient and the remainder for obtaining first field divided by parameter preset.
Memory module 303, for storing the information of home location of the number to the first storage region of memory space.
The initial address of first storage region is that physical block address is the quotient, and offset address is the remainder, and first deposits
The byte length in storage area domain is preset length.
Assuming that above-mentioned number is cell-phone number, the number section of the cell-phone number is 1503328, and the first field is 503328, this is default
Parameter is 3/2, then the physical block address of the corresponding information of home location of the cell-phone number is 754992, offset address 0.
Information of home location can be Chinese character title, phonetic title or the number of ownership place.
An embodiment of the present invention provides a kind of information of home location storage device, memory module 303 believes the ownership place of number
Breath is stored in memory space, while the initial address of the first storage region of storage information of home location can obtain mould by second
Block 302 is obtained by the quotient and the remainder of the first field and parameter preset in number, and the initial address of the first storage region is object
Reason block address is above-mentioned quotient, and offset address is above-mentioned remainder, and the byte length of the first storage region is preset length, to be to look into
It looks for information of home location to provide a convenient, for example, when requiring to look up the information of home location of a certain number, can directly calculate and return
The physical address of possession information, and know that the byte length of the information of home location is preset length, it is possible to from memory space
The information of home location of the number is directly obtained, to which the time of the ownership place to save lookup number provides foundation.
Parameter preset in above-mentioned information of home location storage device embodiment can be N/M, and M is that the minimum of memory space is deposited
The factor of the byte length of storage unit, N are the positive integer more than or equal to 1, a kind of information of home location provided in an embodiment of the present invention
Storage device can also include:Computing module, the byte length for calculating N/M and the minimum memory unit of the memory space
Product, the product be the preset length.
Such as when the byte length of the minimum memory unit of memory space is 8, then M can be 2,4 or 8.Parameter preset can
Think 3/2,9/8 etc., it is assumed that the byte length of parameter preset 3/2, the minimum memory unit of memory space is 8, then presets
Length is 12 bytes.
It is understood that memory space is limited, if the Chinese character of ownership place or phonetic transcriptions of Chinese characters are stored directly in
Many bytes may be occupied in first storage region, can be that each ownership place setting one is compiled to save memory space
Number, which is stored in the first storage region.
Assuming that all ownership place in the prior art probably have more than 400, can return successively to each since number 1
Possession is numbered, wherein 0 is expressed as sky ownership place, i.e., is not present without the ownership place namely the number.
The byte length of the minimum memory unit of memory space can be 8, be 255 since 1 byte maximum preserves numerical value,
And the number of all ownership place is 400 or so, so 9 bit are needed, so the minimum value of N/M can be 9/8, certainly
N/M may be 3/2, and the embodiment of the present invention is not defined the occurrence of parameter preset.
Referring to Fig. 4, being a kind of structural schematic diagram of information of home location acquisition device provided in an embodiment of the present invention, the dress
It sets and may include:First acquisition module 401, the second acquisition module 402, determining module 403 and third acquisition module 404,
In:
First acquisition module 401, for obtaining the first field from number, first field includes identifying the number
Information of home location number.
First field includes the number for the information of home location for identifying above-mentioned number.
First field can be all numbers of number, or the number section in number, such as number section 1358555(It is right
For cell-phone number), number section 0312(For home Tel).
Assuming that above-mentioned number is 15033745663, then the first field can be 15033745663(Entire number), also may be used
It is 1503374(Number section)Or 15033745 or 150337456 or 1503374566.
Since first of cell-phone number in the prior art is all 1, the data for really carrying information of home location are next 6
Position, so can be identified for that the number of the information of home location of number can be 503374, i.e. the first field can be the in number section
Two to the 7th bit digital.Above-mentioned first field can also be 5033745 etc., and the embodiment of the present invention is not to the first field
Particular content is construed as limiting, as long as the number of the information of home location including can be identified for that above-mentioned number.
Second acquisition module 402, the quotient and the remainder for obtaining first field divided by parameter preset.
Determining module 403, for determining the first storage region from the memory space.
It is the quotient that the initial address of first storage region, which is physical block address, and offset address is the remainder, described the
The byte length of one storage region is preset length.
Assuming that above-mentioned number is cell-phone number, the number section of the cell-phone number is 1503328, and the first field is 503328, this is default
Parameter is 3/2, then the physical block address of the corresponding information of home location of the cell-phone number is 754992, offset address 0.
Third acquisition module 404, the information of home location for obtaining the number from first storage region.
Information of home location can be Chinese character title, phonetic title or the number of ownership place.
Information of home location acquisition device provided in an embodiment of the present invention, when the information of home location for requiring to look up a certain number
When, the second acquisition module 402 can directly calculate the physical address of information of home location according to the first field and parameter preset, again
Know that the byte length of the information of home location is preset length, so third acquisition module 404 can be straight from the first storage region
Obtain the number information of home location, to save search number ownership place time.
It is understood that memory space is limited, if the Chinese character of ownership place or phonetic transcriptions of Chinese characters are stored directly in
Many bytes may be occupied in first storage region, can be that each ownership place setting one is compiled to save memory space
Number, which is stored in the first storage region, then obtains corresponding ownership place further according to the number.Above-mentioned ownership place letter
Breath includes ownership place number information, which further includes:According to pre-set ownership place number information
With the correspondence of ownership place, the corresponding ownership place of ownership place number information is obtained.
Assuming that all ownership place in the prior art probably have more than 400, can return successively to each since number 1
Possession is numbered, wherein 0 is expressed as sky ownership place, i.e., is not present without the ownership place namely the number.It is above-mentioned to ownership
The method that ground is numbered is an example provided in an embodiment of the present invention, and how the embodiment of the present invention is to not to be ownership place
The method being numbered is defined.
The byte length of the minimum memory unit of memory space can be 8, be 255 since 1 byte maximum preserves numerical value,
And the number of all ownership place is 400 or so, so 9 bit are needed, so the minimum value of N/M can be 9/8, certainly
N/M may be 3/2, and the embodiment of the present invention is not defined the occurrence of parameter preset.
Information of home location in above-mentioned information of home location storage method and device due to being stored in memory space, institute so as to
In transplanting and multiplexing.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight
Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other.
For device or system class embodiment, since it is basically similar to the method embodiment, so description is fairly simple, it is related
Place illustrates referring to the part of embodiment of the method.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory(RAM), memory, read-only deposit
Reservoir(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.