A kind of address correcting method and device
Technical field
The present invention relates to data processing fields, more particularly to a kind of address correcting method and device.
Background technology
Currently, net purchase has become one of the main path that people buy commodity, user fills in waybill letter when buying commodity
After ceasing (including waybill address), directly place an order.But since user voluntarily fills in waybill address, it often will appear and fill in
Mistake, as occurred the problems such as wrong word, address multiword or few word, unisonance wrongly written character in address, if not carried out to these waybill addresses
It corrects, it would be possible to cause waybill address when lower list mistake occur, commodity can not be accurately sent to.
How to realize before user places an order, the waybill address that user voluntarily fills in is modified, then becomes at present urgently
Technical problem to be solved.
Invention content
In order to solve the above technical problem, the present invention provides a kind of address correcting method and devices, to solve existing skill
The technical issues of waybill address can not being corrected in art.
The embodiment of the invention discloses following technical solutions:
A kind of address correcting method, including:
Receive address to be corrected;
Geocoding is carried out to the address to be corrected, if geocoding fails, executes following steps:
The address to be corrected is segmented, formed described in address to be corrected address fragment;
Each address fragment is matched with the POI in preset point of interest POI data library;
If candidate POI corresponding with the address to be corrected can be matched to, the frequency is chosen from the candidate POI and is more than
Equal to the candidate POI of preset frequency threshold value;
According to the road information of the address to be corrected, the frequency of the candidate POI of selection and candidate's POI location informations, from
Target POI corresponding with the address to be corrected is determined in the candidate POI of the selection;
The address to be corrected is corrected according to the target POI.
A kind of address correcting device, including:
Receiving unit, for receiving address to be corrected;
Coding unit, if geocoding fails, triggers first point for carrying out geocoding to the address to be corrected
Word unit:
First participle unit, for being segmented to the address to be corrected, formed described in address to be corrected ground
Location segment;
Matching unit, for matching each address fragment with the POI in preset point of interest POI data library;If energy
It is matched to candidate POI corresponding with the address to be corrected, then triggers selection unit;
Selection unit, the candidate POI for being more than or equal to preset frequency threshold value for choosing the frequency from the candidate POI;
Determination unit, for the frequency of the candidate POI of the road information of address to be corrected, selection and candidate according to
POI location informations determine target POI corresponding with the address to be corrected from the candidate POI of the selection;
Unit is corrected, for being corrected to the address to be corrected according to the target POI.
Technical solution provided in an embodiment of the present invention is receiving when correcting address, carries out ground to the address to be corrected
Reason coding confirms that the address to be corrected is wrong address when geocoding fails, and is corrected to the address to be corrected, and entangles
Positive process is as follows:The address to be corrected is segmented, formed described in address to be corrected address fragment;By each address
Segment is matched with the POI in preset POI data library;Candidate corresponding with the address to be corrected is obtained if can match
POI then chooses the candidate POI that the frequency is more than or equal to preset frequency threshold value from the candidate POI;According to the address to be corrected
Road information, selection candidate POI the frequency and candidate's POI location informations, determined from the candidate POI of the selection with
The corresponding target POI in the address to be corrected;The address to be corrected is corrected according to the target POI.Using this hair
The address correcting method of bright offer, on the one hand, by the POI in the address fragment of address to be corrected and preset POI data library into
Row matching, to obtain candidate POI corresponding with address to be corrected, since the POI in POI data library is adopted by advance scene
Collect obtained POI, the address of these POI is very accurately, it is accordingly possible to ensure candidate POI corresponding with address to be corrected
Be title, the accurate POI in address, ensure that the title of the target POI chosen from candidate POI, address be it is accurate,
Then the accuracy for being treated according to target POI and correcting address and being corrected is improved to a certain extent;On the other hand, the frequency compared with
High candidate POI is usually relatively conventional POI, and common POI becomes the possibility bigger of the destination address of user's inquiry,
In addition, if address to be corrected includes road information, if the position of candidate POI is located on the road of address to be corrected place or week
It is determined from the candidate POI of high frequency time then according to the location information of the road information and candidate POI of address to be corrected on side
Target POI is the possibility higher of the exact address of address to be corrected, and therefore, correction ground is treated according to the target POI determined
The accuracy higher that location is corrected improves to treat and corrects the accuracy that address is corrected.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention without having to pay creative labor, may be used also for those of ordinary skill in the art
With obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of method flow diagram of address correcting method provided in an embodiment of the present invention;
Fig. 2 is a kind of one of structural schematic diagram of address correcting device provided in an embodiment of the present invention;
Fig. 3 is a kind of second structural representation of address correcting device provided in an embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical solution in the embodiment of the present invention is explicitly described, it is clear that described embodiment is the present invention
A part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not having
The every other embodiment obtained under the premise of creative work is made, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is a kind of method flow diagram of address correcting method provided in an embodiment of the present invention, as shown in Figure 1, the side
Method includes:
S101:Receive address to be corrected.
For example, the address to be corrected received can be by input by user.
S102:Geocoding is carried out to the address to be corrected, if geocoding fails, executes following steps S103-
S106。
For example, the geocoding (geocoding) can be understood as whether address to be corrected described in determination has
Corresponding geographical address, the geographical address may include coordinate value etc..When the address to be corrected can not successfully carry out geography
Coding, it can be understood as the address to be corrected and known POI (Point of Interest, point of interest) are not exactly the same,
It needs to be repaired, needs the address to be corrected being corrected as known correct address in other words.It is true if geocoding success
Surely address to be corrected is accurate, without correcting, terminates flow.
S103:The address to be corrected is segmented, formed described in address to be corrected address fragment.
For example, the operation segmented can be understood as splitting the address to be corrected, for example described wait for
Correct address be specially " high bridge town high bridge new city swan spring apartment ", by participle formed described in address to be corrected address
Segment may include " high bridge town ", " high bridge new city ", " swan spring apartment ".In the embodiment of the present invention, address is segmented
Mode is varied, and existing more conventional participle mode may be used, and ((forward direction is most for the segmenting method such as based on string matching
Big matching method, reverse maximum matching method, minimum cutting etc.), the segmenting method based on understanding and the segmenting method based on statistics),
This programme is not specifically limited.
S104:Each address fragment is matched with the POI in preset POI data library.
The present invention does not limit matched mode, the embodiment of the present invention also provide by each address fragment with it is preset
POI in POI data library carries out matched mode, wherein the matching may include by converting each address fragment
It is index with the phonetic of address fragment for phonetic, the phonetic that the address fragment is searched in preset POI data library is index pair
The POI answered;Alternatively, the matching may include calculating between each address fragment and the title of the POI in preset POI data library
Editing distance (Edit Distance), the editing distance can be understood as each address fragment being converted into the POI
Required number;Alternatively, it is described matching may include not only by the matching of phonetic mode, also include by calculate editor away from
Matching from mode.
In wherein S104, each address fragment is matched with the POI in preset POI data library, specifically can be used with
Lower four kinds of modes are realized:
Mode 1 is directed to each address fragment, is that index is searched in preset POI data library with the phonetic of the address fragment
Rope POI corresponding with the phonetic, and when searching POI corresponding with the phonetic, the POI searched is waited for as described in
Correct the corresponding candidate POI in address.
Mode 2 is directed to each address fragment, calculates separately the name of the address fragment and each POI in preset POI data library
The editing distance of title, editing distance is less than or equal to preset editing distance threshold value, and (such as editing distance threshold value could be provided as 1~3
In arbitrary value, the corresponding candidate POI in the address to be corrected as described in POI 2) is taken to be used as.
Mode 3 is directed to each address fragment, is that index is searched in preset POI data library with the phonetic of the address fragment
Rope POI corresponding with the phonetic, and when searching POI corresponding with the phonetic, the POI searched is waited for as described in
Correct the corresponding candidate POI in address;And for each address fragment, the address fragment and preset POI data are calculated separately
The editing distance of the title of each POI in library, the POI that editing distance is less than or equal to preset editing distance threshold value wait entangling as described in
The positive corresponding candidate POI in address.
Mode 4 is directed to each address fragment, is that index is searched in preset POI data library with the phonetic of the address fragment
Rope POI corresponding with the phonetic, and when searching POI corresponding with the phonetic, the POI searched is waited for as described in
Correct the corresponding candidate POI in address;If all address fragments do not search corresponding candidate POI,:For each address slice
Section calculates separately the editing distance of the address fragment and the title of each POI in preset POI data library, editing distance is less than
Equal to the corresponding candidate POI in address to be corrected described in the POI of preset editing distance threshold value conducts.
Assuming that address to be corrected is " Suzhou Street, Haidian District, Beijing City great river dress garden cell ", the address fragment obtained after participle
For " Beijing ", " Haidian District ", " Su Zhoujie ", " great river dress garden cell ", by taking address fragment " great river dress garden cell " as an example, by it
It is " dahezhuangyuanxiaoqu " to be converted into phonetic, is that index is matched in preset POI data library with the phonetic, obtains
Be " great river village garden cell " to POI corresponding with the phonetic, then the corresponding candidate POI in the address to be corrected as described in using the POI.
S105:Candidate POI corresponding with the address to be corrected is obtained if can match, is chosen from the candidate POI
The frequency is more than or equal to the candidate POI of preset frequency threshold value.
For example, the frequency can be understood as a known POI be determined as target POI number it is (including selected
It is set to the number of the target POI of POI to be corrected, and/or, include by the number as exact address).When a POI is true
It is set to one when the corresponding target POI in correction address, the frequency of this POI is 1 time cumulative.Due to number of addresses input by user
Grade is very big, wherein the data level of address to be corrected also can be very big, if a POI in POI data library waits entangling as other
The number of the target POI of positive address is more, it was demonstrated that this POI is more accurate, confidence level is higher.The preset frequency threshold value can basis
Actual demand is flexibly arranged, and this programme is not made specifically to limit, and such as could be provided as 100-500 times.
S106:Believed according to the road information of the address to be corrected, the frequency of the candidate POI of selection and the candidate positions POI
Breath determines target POI corresponding with the address to be corrected from the candidate POI of the selection.
For example, the such as described address to be corrected is " Suzhou Street, Haidian District, Beijing City great river dress garden cell ", then institute
The road information for stating address to be corrected is just " Su Zhoujie ".
Optionally, in aforementioned S106, according to the road information of the address to be corrected, the candidate POI of selection the frequency and
Candidate POI location informations determine target POI corresponding with the address to be corrected, specifically from the candidate POI of the selection
Realization may include:
Road information is extracted from the address to be corrected;
If can extract, according to the position for the road that the location information of the candidate POI of selection and the road information indicate
Confidence ceases, and determines the candidate POI for being less than or equal to preset distance threshold value at a distance from the road, and the candidate POI that will be determined
The middle highest candidate POI of the frequency is as target POI;Optimally, the distance threshold is set as zero;
If cannot extract, using the highest POI of the frequency in the POI chosen in the S105 as target POI.
For example, in the such as above-mentioned address " Suzhou Street, Haidian District, Beijing City great river dress garden cell " to be corrected just
With road information, road information " Su Zhoujie " can be extracted, then according to the location information of the candidate POI of selection and the road
The location information of the road of information instruction determines the candidate POI for being less than or equal to preset distance threshold value at a distance from the road, and
Using the highest candidate POI of the frequency in the candidate POI determined as target POI.
By judging that the position of the road of the location information of candidate POI and the road information instruction of the address to be corrected is believed
Breath the distance between relationship, can the frequency in the candidate POI is very high but location information and the address to be corrected road
The candidate POI of the distance of the location information of the road of road information instruction farther out is excluded, and thereby guarantees that the target POI's determined
Accuracy is relatively high.
If the address to be corrected is " high bridge town high bridge new city swan spring apartment ", wherein do not have road information, therefore not
Road information can be extracted, then using the highest POI of the frequency in the candidate POI of the selection as target POI.
S107:The address to be corrected is corrected according to the target POI.
In general, the address to be corrected may include address information and name information.Optionally, S107 is implemented
It can be as follows:Address information and name information are identified from the address to be corrected;It is entangled according to the address information of the target POI
Address information in the just described address to be corrected, and, according in address to be corrected described in the correction of the title of the target POI
Name information.Such as address to be corrected is " Suzhou Street, Haidian District, Beijing City great river dress garden cell ", it is " great river to obtain target POI
The address information of village garden cell ", target POI is " Suzhou Street, Haidian District, Beijing City 3 ";It is then treated and is entangled according to target POI
Positive address correct as follows:It is " Suzhou Street, Haidian District, Beijing City ", name information to go out address information from Address Recognition to be corrected
For " great river dress garden cell ", then the address information of address to be corrected is revised as by " Beijing sea according to the address information of target POI
The name information of address to be corrected is revised as " great river village garden cell " according to the title of target POI, obtained by shallow lake area Suzhou street 3 "
Address after to correction is " No. 3 great rivers in Suzhou Street, Haidian District, Beijing City village garden cell ".
It is also to be noted that match each address fragment with the POI in preset POI data library in S104,
If cannot obtain with described when the corresponding candidate POI in correction address, S103 will be re-executed, treated by S103 and correct address
Again segmented, formed described in address to be corrected new address fragment, and be directed to new address fragment, execute it is described will be each
The step of address fragment is matched with the POI in preset POI data library, it is corresponding with the address to be corrected until obtaining
Until candidate POI.
Technical solution provided in an embodiment of the present invention is receiving when correcting address, carries out ground to the address to be corrected
Reason coding confirms that the address to be corrected is wrong address when geocoding fails, and is corrected to the address to be corrected, and entangles
Positive process is as follows:The address to be corrected is segmented, formed described in address to be corrected address fragment;By each address
Segment is matched with the POI in preset POI data library;Candidate corresponding with the address to be corrected is obtained if can match
POI then chooses the candidate POI that the frequency is more than or equal to preset frequency threshold value from the candidate POI;According to the address to be corrected
Road information, selection candidate POI the frequency and candidate's POI location informations, determined from the candidate POI of the selection with
The corresponding target POI in the address to be corrected;The address to be corrected is corrected according to the target POI.Using this hair
The address correcting method of bright offer, on the one hand, by the POI in the address fragment of address to be corrected and preset POI data library into
Row matching, to obtain candidate POI corresponding with address to be corrected, since the POI in POI data library is adopted by advance scene
Collect obtained POI, the address of these POI is very accurately, it is accordingly possible to ensure candidate POI corresponding with address to be corrected
Be title, the accurate POI in address, ensure that the title of the target POI chosen from candidate POI, address be it is accurate,
Then the accuracy for being treated according to target POI and correcting address and being corrected is improved to a certain extent;On the other hand, the frequency compared with
High candidate POI is usually relatively conventional POI, and common POI becomes the possibility bigger of the destination address of user's inquiry,
In addition, if address to be corrected includes road information, if the position of candidate POI is located on the road of address to be corrected place or week
It is determined from the candidate POI of high frequency time then according to the location information of the road information and candidate POI of address to be corrected on side
Target POI is the possibility higher of the exact address of address to be corrected, and therefore, correction ground is treated according to the target POI determined
The accuracy higher that location is corrected improves to treat and corrects the accuracy that address is corrected.
Embodiment two
Fig. 2 is a kind of structure chart of address correcting device provided in an embodiment of the present invention, including:
Receiving unit 201, for receiving address to be corrected.
Coding unit 202, if geocoding fails, triggers for carrying out geocoding to the address to be corrected
One participle unit 203:
First participle unit 203, for being segmented to the address to be corrected, formed described in address to be corrected
Address fragment.
Matching unit 204, for matching each address fragment with the POI in preset point of interest POI data library;If
It can be matched to candidate POI corresponding with the address to be corrected, then trigger selection unit 205;
Selection unit 205, the candidate POI for being more than or equal to preset frequency threshold value for choosing the frequency from the candidate POI.
Determination unit 206, the frequency and time for the candidate POI of the road information of address to be corrected, selection according to
POI location informations are selected, target POI corresponding with the address to be corrected is determined from the candidate POI of the selection.
Unit 207 is corrected, for being corrected to the address to be corrected according to the target POI.
Optionally, the matching unit 204, is specifically used for:
For each address fragment, searched in preset POI data library using the phonetic of the address fragment as index and institute
The corresponding POI of phonetic is stated, and when searching POI corresponding with the phonetic, the POI searched is waited to correct ground as described in
The corresponding candidate POI in location;And/or
For each address fragment, the volume of the address fragment and the title of each POI in preset POI data library is calculated separately
Editing distance is less than or equal to the corresponding candidate in the address to be corrected as described in the POI of preset editing distance threshold value by volume distance
POI。
Optionally, the determination unit 206, is specifically used for:
Road information is extracted from the address to be corrected;
If can extract, according to the position for the road that the location information of the candidate POI of selection and the road information indicate
Confidence ceases, and determines the candidate POI for being less than or equal to preset distance threshold value at a distance from the road, and the candidate POI that will be determined
The middle highest candidate POI of the frequency is as target POI;
If cannot extract, using the highest POI of the frequency in the candidate POI of the selection as target POI.
Optionally, the correction unit 207, is specifically used for:
Address information and name information are identified from the address to be corrected;
According to the address information in address to be corrected described in the correction of the address information of the target POI, and, according to described
Name information in address to be corrected described in the title correction of target POI.
Optionally, the device of the embodiment of the present invention can also further comprise the second participle unit on the basis of Fig. 2
208, as shown in Figure 3:
Second participle unit 208, for time corresponding with the address to be corrected cannot to be obtained in the matching unit 204
When selecting POI, the address to be corrected is segmented again, formed described in address to be corrected new address fragment, and for new
Address fragment triggers the matching unit 204, until the matching unit 204 obtains time corresponding with the address to be corrected
Until selecting POI.
As it can be seen that receiving when correcting address, geocoding is carried out to the address to be corrected, when geocoding fails
Confirm that the address to be corrected is wrong address, and the address to be corrected is corrected, correction procedure is as follows:It waits correcting to described
Address is segmented, formed described in address to be corrected address fragment;It will be in each address fragment and preset POI data library
POI matched;Candidate POI corresponding with the address to be corrected is obtained if can match, is chosen from the candidate POI
The frequency is more than or equal to the candidate POI of preset frequency threshold value;According to the road information of the address to be corrected, the candidate POI of selection
The frequency and candidate's POI location informations, target corresponding with the address to be corrected is determined from the candidate POI of the selection
POI;The address to be corrected is corrected according to the target POI.Using address correcting method provided by the invention, a side
Face matches the address fragment of address to be corrected with the POI in preset POI data library, to obtain and address to be corrected
Corresponding candidate POI, since the POI in POI data library is the POI obtained by advance collection in worksite, the address of these POI
It is very accurate, it is accordingly possible to ensure candidate POI corresponding with address to be corrected is title, the accurate POI in address, from
And ensure that the title of the target POI chosen from candidate POI, address are accurate, then improve root to a certain extent
The accuracy corrected address and corrected is treated according to target POI;On the other hand, the higher candidate POI of the frequency is usually more often
The POI seen, and common POI becomes the possibility bigger of the destination address of user's inquiry, therefore combine the road of address to be corrected
The location information of road information and candidate POI, the target POI determined from the candidate POI of high frequency time are the standard of address to be corrected
The possibility higher of true address, therefore, according to determine target POI treats the accuracy higher corrected address and corrected,
It improves to treat and corrects the accuracy that address is corrected.
As seen through the above description of the embodiments, those skilled in the art can be understood that above-mentioned implementation
All or part of step in example method can add the mode of general hardware platform to realize by software.Based on this understanding,
Substantially the part that contributes to existing technology can embody technical scheme of the present invention in the form of software products in other words
Out, which can be stored in a storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions
With so that a computer equipment (can be that the network communications such as personal computer, server, or Media Gateway are set
It is standby) execute method described in certain parts of each embodiment of the present invention or embodiment.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment it
Between just to refer each other for identical similar part, each embodiment focuses on the differences from other embodiments.
For equipment and system embodiment, since it is substantially similar to the method embodiment, so describe fairly simple,
The relevent part can refer to the partial explaination of embodiments of method.Equipment and system embodiment described above is only schematic
, wherein may or may not be physically separated as the unit that separating component illustrates, shown as unit
Component may or may not be physical unit, you can be located at a place, or may be distributed over multiple networks
On unit.Some or all of module therein can be selected according to the actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art are without creative efforts, you can to understand and implement.
The above is only a preferred embodiment of the present invention, it is not intended to limit the scope of the present invention.It should refer to
Go out, for those skilled in the art, without departing from the principle of the present invention, can also make several
Improvements and modifications, these improvements and modifications also should be regarded as protection scope of the present invention.