Method and device for recalling address data
By combining the recall strategy of address correlation and spatial distance, the problem of inaccurate address data recall in geocoding services in the existing technology is solved, high-precision address data recall is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202410903892.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-08-23
AI Technical Summary
When the candidate address data cannot completely cover the query address, the existing fuzzy matching recall method leads to geographical coordinate feedback deviation, low accuracy, and brings a bad experience to the user.
By calculating the spatial distance factors between addresses, combining correlation and spatial distance, and using a high-precision recall strategy, the address data that is most relevant and closest to the user query is selected from the candidate address data.
It improves the accuracy of address data recall, provides better geocoding services, and meets users' practical application needs.
Smart Images

Figure CN118535669A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for recalling address data. Background Art
[0002] Geocoding service is a process of finding the target address most relevant to the user's query address from a massive address database through search recall and sorting strategies, and feeding back the specific geographic coordinates corresponding to the target address to the user. As an important part of geocoding service, search recall aims to filter out a small number of relevant address sets with the highest relevance to the user's query from the candidate address data. Existing technologies mainly recall address data through fuzzy matching between address texts.
[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:
[0004] The existing fuzzy matching recall method only recalls address data by calculating the correlation between addresses, which is not very accurate, especially when the candidate address data cannot completely cover the query address. For example, the street number or building number information in the address queried by the user is missing in the candidate address data, and the geographic coordinate position fed back to the user may be biased, giving the user a bad experience. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for recalling address data, which realizes the recall of address data with high precision, incorporates the spatial distance factor between addresses into the recall strategy, comprehensively considers the relevance of addresses and the spatial distance of addresses, improves the accuracy of address data recall, and thus provides users with better geocoding services.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for recalling address data is provided, comprising:
[0007] In response to receiving the address data recall request, obtaining a search address input by a user;
[0008] Calculating the relevance between the search address and each address in the pre-acquired candidate address data, and selecting relevant address data from the candidate address data according to the calculation result of the relevance;
[0009] The spatial distance between the search address and each address in the related address data is calculated, and according to the calculation result of the spatial distance, the recalled address data corresponding to the search address is selected from the related address data.
[0010] Optionally, before calculating the correlation between the search address and each address in the pre-acquired candidate address data, the method also includes: obtaining the secondary administrative district of the search address, and filtering out regional address data that is consistent with the secondary administrative district of the search address from the candidate address data; calculating the correlation between the search address and each address in the pre-acquired candidate address data, including: calculating the correlation between the search address and each address in the regional address data.
[0011] Optionally, calculating the relevance between the search address and each address in the regional address data includes: obtaining a detailed address without administrative district information in the search address by text structured splitting of the search address; performing word segmentation processing on the detailed address to obtain a search word segmentation list; and calculating the text relevance score between the search word segmentation list and each address in the regional address data by a word frequency scoring algorithm.
[0012] Optionally, calculating the spatial distance between the search address and each address in the related address data includes: using a pre-built spatial distance prediction model to calculate the spatial distance score between the search address and each address in the related address data.
[0013] Optionally, the spatial distance prediction model is constructed in the following manner: an address with positioning coordinates is selected as a retrieval training address, and according to the positioning coordinates, a corresponding adjacent training address is determined to obtain a training sample; vector encoding is performed on the retrieval training address and the adjacent training address respectively to obtain a retrieval address vector and an adjacent address vector; the retrieval address vector and the adjacent address vector are input into a multi-head attention text understanding module in a preset spatial distance prediction initial model to obtain a retrieval first position vector and an adjacent first position vector; the retrieval first position vector and the adjacent first position vector are then passed through a vector splicing module, a forward neural network and a linear network in the spatial distance prediction initial model to obtain a predicted spatial distance between the retrieval training address and the adjacent training address; according to the predicted spatial distance and the actual spatial distance between the retrieval training address and the adjacent training address, the spatial distance prediction initial model is trained by back propagation and gradient descent algorithm using a mean square error loss function to obtain a spatial distance prediction model.
[0014] Optionally, before using a pre-built spatial distance prediction model to calculate the spatial distance scores between the retrieval address and each address in the related address data, the method also includes: using a multi-head attention text understanding module in the pre-built spatial distance prediction model to calculate the address first position vector of each address in the related address data; using a pre-built spatial distance prediction model to calculate the spatial distance scores between the retrieval address and each address in the related address data, including: using the multi-head attention text understanding module in the spatial distance prediction model to calculate the retrieval first position vector of the retrieval address; based on the retrieval first position vector and the address first position vector, using the vector splicing module, forward neural network and linear network in the spatial distance prediction model to obtain the spatial distance scores between the retrieval address and each address in the related address data.
[0015] Optionally, the method further comprises: integrating the spatial distance prediction model into a search engine-based spatial distance scoring plug-in, so as to calculate the spatial distance scores between the search address and each address in the related address data through the spatial distance scoring plug-in.
[0016] According to a second aspect of an embodiment of the present invention, there is provided a device for recalling address data, comprising:
[0017] A search address acquisition module, configured to acquire a search address input by a user in response to receiving an address data recall request;
[0018] A related address acquisition module, used to calculate the correlation between the search address and each address in the pre-acquired candidate address data, and select the related address data from the candidate address data according to the calculation result of the correlation;
[0019] The recall address acquisition module is used to calculate the spatial distance between the search address and each address in the related address data, and select the recall address data corresponding to the search address from the related address data according to the calculation result of the spatial distance.
[0020] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for storing address data, including:
[0021] one or more processors;
[0022] a storage device for storing one or more programs,
[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.
[0024] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.
[0025] An embodiment of the invention has the following advantages or beneficial effects: by responding to receiving an address data recall request, obtaining a search address input by a user; calculating the correlation between the search address and each address in the pre-acquired candidate address data, and selecting relevant address data from the candidate address data based on the calculation result of the correlation; calculating the spatial distance between the search address and each address in the relevant address data, and selecting the recalled address data corresponding to the search address from the relevant address data based on the calculation result of the spatial distance. The technical solution realizes a high-precision address data recall method, incorporates the spatial distance factor between addresses into the recall strategy, comprehensively considers the correlation of addresses and the spatial distance of addresses, improves the accuracy of address data recall, and thus provides users with better geocoding services. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0027] Figure 1 is a schematic diagram of the main process of the method for recalling address data according to an embodiment of the present invention;
[0028] Figure 2 is a schematic diagram of the initial model training process of an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of a process of obtaining a spatial distance through a spatial distance prediction model according to an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of the overall process of the method for recalling address data according to an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of main modules of a device for recalling address data according to an embodiment of the present invention;
[0032] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0033] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0034] It should be noted that in the technical solution of the present invention, the collection / collection, update, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0035] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0036] The existing fuzzy matching recall method only recalls address data by calculating correlation, which is not very accurate, especially when the candidate address data cannot completely cover the query address. For example, the road number or building number information in the address queried by the user is missing in the candidate address data. The geographic coordinate position fed back to the user may be biased, which brings a bad experience to the user and cannot meet practical applications well.
[0037] In order to solve the above problems existing in the prior art, the present invention proposes a method for recalling address data, which is mainly used for search recall of geocoding services. First, relevant address data related to the search address input by the user is selected from the candidate address data, and then the recalled address data is selected from the relevant address data by calculating the spatial distance between the search address and the address in the relevant address data. A high-precision recall of address data is achieved, the spatial distance factor between addresses is incorporated into the recall strategy, the relevance of addresses and the spatial distance of addresses are comprehensively considered, the accuracy of address data recall is improved, and better geocoding services are provided to users.
[0038] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:
[0039] Lucene algorithm: is an efficient full-text search engine algorithm that uses an inverted index to convert text information into a data structure that can be processed by a computer;
[0040] ES: Elasticsearch is a distributed RESTful search and data analysis engine;
[0041] IK word segmentation: a word segmentation algorithm based on forward matching;
[0042] POI: Point of interests, referred to as point of interest;
[0043] CLS: Encoded vector representing the beginning of a sentence.
[0044] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for recalling address data according to an embodiment of the present invention. Figure 1 As shown, the method for recalling address data according to the embodiment of the present invention includes the following steps S101 to S103.
[0045] Step S101: In response to receiving an address data recall request, obtaining a search address input by a user.
[0046] Specifically, the geocoding service mainly searches and recalls the existing candidate address data based on the search address input by the user, and recalls a small amount of address data closely related to the search address, so that the subsequent sorting module can sort the recalled address data, select an optimal address data, and feedback the geographical longitude and latitude corresponding to the optimal address data to the user. When the system receives an address data recall request, it obtains the search address text input by the user by parsing the address data recall request.
[0047] Step S102: Calculate the relevance between the search address and each address in the pre-acquired candidate address data, and select relevant address data from the candidate address data according to the calculation result of the relevance.
[0048] Specifically, considering that the candidate address data often contains as many as hundreds of thousands or even millions of addresses, in order to improve the recall efficiency, the relevance between each address in the candidate address data and the search address is first calculated. The specific relevance calculation can adopt a commonly used text similarity algorithm, such as a cosine similarity algorithm, a semantic similarity algorithm, etc. According to the calculation result of the relevance, a specified number of addresses are selected from the candidate address data to form the relevant address data of the search address. The embodiment of the present invention selects the top 500 most relevant addresses to form the relevant address data.
[0049] According to one embodiment of the present invention, before calculating the correlation between the search address and each address in the pre-acquired candidate address data, the method further includes: obtaining the secondary administrative district of the search address, and filtering out regional address data that is consistent with the secondary administrative district of the search address from the candidate address data; calculating the correlation between the search address and each address in the pre-acquired candidate address data, including: calculating the correlation between the search address and each address in the regional address data.
[0050] Specifically, in order to improve the efficiency of selecting the above-mentioned relevant address data, before calculating the correlation between the search address and each address in the pre-acquired candidate address data, the search address is parsed for administrative districts to obtain the secondary administrative districts, and the addresses that are consistent with the secondary administrative districts of the search address are screened out from the candidate address data to form the regional address data. Specifically, the addresses that are consistent with the secondary administrative districts can be filtered out from the candidate address data through the ES filter. In this way, the subsequent correlation calculation only needs to calculate the correlation between the search address and each address in the regional address data, which effectively reduces the amount of calculation of the correlation calculation, saves computing resources, and improves computing efficiency.
[0051] According to another embodiment of the present invention, the correlation between the search address and each address in the regional address data is calculated, including: obtaining a detailed address without administrative district information in the search address by structurally splitting the text of the search address; performing word segmentation processing on the detailed address to obtain a search word segmentation list; and calculating the text correlation score between the search word segmentation list and each address in the regional address data through a word frequency scoring algorithm.
[0052] Specifically, the address text relevance calculation of the embodiment of the present invention uses the word frequency scoring Lucene algorithm, which needs to perform text structured splitting and parsing on the search address, identify the administrative districts therein, and extract the detailed address without administrative district information. For example, the detailed address obtained after text structured splitting of No. 1601, Building 5, XXX Community, No. 15, XX Road, District C, D Street, City B, Province A is: No. 1601, Building 5, XXX Community, No. 15, XX Road. The detailed address is then segmented, and one segmentation method can be selected, or two segmentation methods can be combined. The embodiment of the present invention uses two preset segmentation methods to perform segmentation on the detailed address, and then the results of the two segmentation processes are merged to remove duplicates to obtain a search segmentation list. For example, using the IK segmentation and CRF segmentation supported by ES, the sets obtained by the two segmentations are merged to remove duplicates to obtain a search segmentation term list. Using two segmentation methods can improve the accuracy of segmentation to ensure the quality of the selected relevant address data.
[0053] Furthermore, based on the above obtained search term list, the term frequency scoring Lucene algorithm is used. The specific Lucene scoring formula is as follows:
[0054]
[0055] in, It indicates the relevance score of the search address q in each address d in the regional address data; TF indicates the frequency of the word segmentation t in each address d in the regional address data. The greater the frequency, the higher the score; t.getBoost() indicates the custom weight of t, which is a hyperparameter and defaults to 1.0; norm(t,d) indicates the normalization factor of the length of the word segmentation t. The formula is as follows, where numTerms indicates the total number of words:
[0056]
[0057] queryNorm(q) refers to the query weight factor, and the formula is as follows, where q.getBoost() represents the custom weight of the retrieval address, which defaults to 1.0:
[0058]
[0059] coord(q,d) represents the scoring factor, , where overlap represents the number of hits of the word in the search address, maxOverlap represents the total number of words in the search address; IDF represents the inverse document frequency, which is used to represent the rarity of the word in the regional address data:
[0060] ,
[0061] Among them, numDocs represents the number of addresses in the regional address data, and docFreq represents the number of addresses containing the word t in the regional address data.
[0062] By using the above-mentioned Lucene scoring algorithm, the search word list of the search address and the text relevance score of each address in the regional address data can be calculated.
[0063] Step S103: Calculate the spatial distance between the search address and each address in the related address data, and select the recalled address data corresponding to the search address from the related address data according to the calculation result of the spatial distance.
[0064] Specifically, based on the above-selected related address data, the embodiment of the present invention further performs screening, adds spatial distance to the screening factors, and calculates the spatial distance between the search address and each address in the related address data. Specifically, the text features of the search address and each address in the related address data can be understood through the semantic understanding module, and then the spatial distance value between the search address and each address in the related address data is evaluated and calculated in combination with the geographical distribution features of each address in the related address data. Finally, based on the spatial distance value obtained by the evaluation and calculation, each address in the related address data is sorted in ascending order according to the spatial distance value from the search address, and a specified number of addresses are selected from the sorted addresses as the recalled address data. The embodiment of the present invention selects the first 50 addresses as the recalled address data.
[0065] According to one embodiment of the present invention, calculating the spatial distance between the retrieval address and each address in the related address data includes: using a pre-built spatial distance prediction model to calculate the spatial distance score between the retrieval address and each address in the related address data.
[0066] Specifically, the embodiments of the present invention utilize the powerful address text understanding, spatial location association, and reasoning capabilities of the natural language model, and use a pre-built spatial distance prediction model based on address text to predict the spatial distance between the retrieved address and each address in the related address data through the model, and determine the corresponding spatial distance score based on the spatial distance value output by the prediction model.
[0067] According to another embodiment of the present invention, the spatial distance prediction model is constructed in the following manner: an address with positioning coordinates is selected as a retrieval training address, and according to the positioning coordinates, a corresponding adjacent training address is determined to obtain a training sample; vector encoding is performed on the retrieval training address and the adjacent training address respectively to obtain a retrieval address vector and an adjacent address vector; the retrieval address vector and the adjacent address vector are input into a multi-head attention text understanding module in a preset spatial distance prediction initial model to obtain a retrieval first position vector and an adjacent first position vector; the retrieval first position vector and the adjacent first position vector are then passed through a vector splicing module, a forward neural network and a linear network in the spatial distance prediction initial model to obtain a predicted spatial distance between the retrieval training address and the adjacent training address; according to the predicted spatial distance and the actual spatial distance between the retrieval training address and the adjacent training address, the spatial distance prediction initial model is trained by back propagation and gradient descent algorithm using a mean square error loss function to obtain a spatial distance prediction model.
[0068] Specifically, the quality of the spatial distance prediction model determines the quality of the recalled address data. In order to ensure the quality of the address data recalled by the embodiment of the present invention, before using the pre-constructed spatial distance prediction model to calculate the spatial distance score between the retrieval address and each address in the related address data, a comprehensive model training is required. First, a training sample is constructed. The embodiment of the present invention selects an address with accurate positioning coordinates as a retrieval training address. Accordingly, the address of the POI near the accurate positioning coordinates is used as the corresponding adjacent training address. The retrieval training address and the corresponding adjacent training address constitute a training sample. The retrieval training address and the adjacent training address are vector-encoded respectively. The specific vector encoding method can be to vector-encode each character in the retrieval training address and the corresponding adjacent training address with the character as the encoding granularity, or to vector-encode each word according to the result of the above-mentioned word segmentation processing, and the vector encoding of the word segmentation and the vector encoding of the character are fused to obtain a fused vector of the retrieval training address and a fused vector of the adjacent training address.
[0069] Furthermore, the encoded retrieval address vector and adjacent address vector are respectively input into the multi-head attention text understanding module in the spatial distance prediction initial model to obtain the first position ([CLS]) vector of the retrieval training address text and the adjacent first position ([CLS]) vector of the adjacent training address text. In order to enhance the understanding ability of the model and speed up the training process, the vector concatenation module in the spatial distance prediction initial model is used to concatenate the retrieval first position vector V1 and the adjacent first position vector V2 to obtain the processed vector V3, V3={V1, V2, V1+V2, V1-V2}, where {} represents the vector concatenation operation, "+" represents vector addition, and "-" represents vector subtraction. The processed vectors are then sequentially input into the forward neural network and the linear network in the spatial distance prediction initial model to obtain the predicted spatial distance between the retrieval training address and the adjacent training address.
[0070] Finally, based on the predicted spatial distance output by the initial model, combined with the real spatial distance between the retrieved training address and the POIs adjacent to the training address, the mean square error (MSE) is used as the loss function, and the initial model is trained through back propagation and gradient descent algorithms to obtain a spatial distance prediction model that can be used to predict and calculate the spatial distance scores between the above-mentioned retrieved addresses and each address in the related address data.
[0071] Figure 2It is a schematic diagram of the initial model training process of an embodiment of the present invention. The embodiment of the present invention performs vector encoding at the text granularity, sets the maximum length of the text of the retrieval training address and the adjacent training address to L, uses zero vectors to fill the part of the actual length that is insufficient, and discards the part that exceeds the length. The encoding vector length of each word is M-dimensional, and the retrieval address vector and the adjacent address vector after encoding are both L*M-dimensional. The retrieval address vector and the adjacent address vector are input into the multi-head attention text understanding module in the dotted box in the figure. It can be seen that the multi-head attention text understanding module includes a multi-head attention submodule and a corresponding residual and normalization processing submodule, as well as a forward neural network and a corresponding residual and normalization processing submodule. The multi-head attention text understanding module outputs a 1*M-dimensional retrieval first position vector V1 and a 1*M-dimensional adjacent first position vector V2 respectively; through the vector splicing module, V1 and V2 are spliced to obtain a 1*4M-dimensional vector V3. Subsequently, V3 is output as a 1*N-dimensional vector V4 through a forward neural network, and then a linear network is used to perform a linear transformation on V4 to obtain a 1*1-dimensional V5, which is the predicted spatial distance. Finally, the real spatial distance between the retrieved training address and the POIs near the training address is combined, and the mean square error (MSE) is used as the loss function to train the initial model through back propagation and gradient descent algorithms.
[0072] According to another embodiment of the present invention, before using a pre-built spatial distance prediction model to calculate the spatial distance scores between the retrieval address and each address in the related address data, the method also includes: using a multi-head attention text understanding module in the pre-built spatial distance prediction model to calculate the address first position vector of each address in the related address data; using the pre-built spatial distance prediction model to calculate the spatial distance scores between the retrieval address and each address in the related address data, including: using the multi-head attention text understanding module in the spatial distance prediction model to calculate the retrieval first position vector of the retrieval address; according to the retrieval first position vector and the address first position vector, using the vector splicing module, the forward neural network and the linear network in the spatial distance prediction model to obtain the spatial distance scores between the retrieval address and each address in the related address data.
[0073] Specifically, in order to speed up the prediction speed of the model, before using the pre-built spatial distance prediction model to calculate the spatial distance scores between the search address and each address in the related address data, the multi-head attention text understanding module in the pre-built spatial distance prediction model is used in advance to calculate the address head position vector of each address in the related address data corresponding to the search address, that is, Figure 2In this way, when using the pre-built spatial distance prediction model to calculate the spatial distance scores between the search address and each address in the related address data, the search first position vector of the search address can be calculated only by the multi-head attention text understanding module; then the address first position vector and the search first position vector calculated in advance are subjected to vector concatenation processing, as well as linear conversion of the forward neural network and the linear network, to quickly obtain the spatial distance output by the model, and then obtain the corresponding spatial distance score.
[0074] Figure 3 It is a flow chart of obtaining spatial distance through a spatial distance prediction model in an embodiment of the present invention. The spatial distance prediction model receives the search address, obtains the search first position vector V1 of the search address through the multi-head attention text understanding module, and then combines the address first position vector V2 of each address in the related address data obtained by offline calculation in advance, performs vector splicing processing, and obtains V3. Then, the spliced V3 vector is output through a forward neural network and a linear network to output the spatial distance between the search address and each address in the related address data.
[0075] According to another embodiment of the present invention, the method further includes: integrating the spatial distance prediction model into a search engine-based spatial distance scoring plug-in to calculate the spatial distance scores between the retrieval address and each address in the related address data through the spatial distance scoring plug-in.
[0076] Specifically, the embodiment of the present invention develops an integrated plug-in for the spatial distance prediction model, based on the search engine ES with high concurrent computing capabilities, by executing the method of the script plug-in ScriptPlugin interface. The spatial distance scoring plug-in is not only easy to manage and maintain, but also easy to promote and use, ensuring the implementation of the present invention.
[0077] Figure 4It is a schematic diagram of the overall process of the address data recall method of an embodiment of the present invention. According to the address data recall request, the search address is obtained, and the search address is subjected to text preprocessing such as text structured splitting to identify the administrative district information and detailed address therein; then the administrative district information is parsed to obtain the secondary administrative district, and the detailed address is segmented to obtain a search word list of the detailed address. According to the obtained secondary administrative district, the regional address data consistent with the secondary administrative district is screened out from the candidate address data, and the text relevance score of each address in the search word list and the regional address data is calculated by the Lucen algorithm for word frequency scoring to perform relevance scoring. According to the scoring results, each address in the regional address data is sorted in descending order of score, and the top 500 addresses with the highest relevance scores are selected as the relevant address data corresponding to the search address. Finally, the searched address and related address data are input into the spatial distance scoring plug-in developed based on the spatial distance prediction model to obtain the spatial distance score of each address in the searched address and related address data, and each address in the related address data is sorted in ascending order according to the spatial distance score. The first 50 addresses are returned as recalled address data to the requester of the address data recall request.
[0078] According to the retrieved retrieval address, the embodiment of the present invention first calculates the text relevance between each address in the candidate address data and the retrieval address, obtains a relevance score, and selects relevant address data from the candidate address data according to the relevance score result. Then, with the help of the powerful address text understanding ability, spatial position association ability, and reasoning calculation ability of the natural language model, the constructed spatial distance prediction model is used to predict and calculate the spatial distance between each address in the relevant address data and the retrieval address, and the address data with stronger relevance and closer distance to the retrieval address is recalled from the relevant address data. A multiple recall strategy of address text relevance and spatial distance value is implemented, providing high-quality address data for the subsequent sorting strategy of geocoding services, and ensuring the accuracy of the target address finally determined.
[0079] Figure 5 FIG. 2 is a schematic diagram of the main modules of the device for recalling address data according to an embodiment of the present invention. Figure 5 As shown, the address data recall device 500 mainly includes a search address acquisition module 501 , a related address acquisition module 502 and a recall address acquisition module 503 .
[0080] A search address acquisition module 501 is used to acquire a search address input by a user in response to receiving an address data recall request;
[0081] A related address acquisition module 502 is used to calculate the correlation between the search address and each address in the pre-acquired candidate address data, and select the related address data from the candidate address data according to the calculation result of the correlation;
[0082] The recall address acquisition module 503 is used to calculate the spatial distance between the search address and each address in the related address data, and select the recall address data corresponding to the search address from the related address data according to the calculation result of the spatial distance.
[0083] According to one embodiment of the present invention, the address data recall device 500 also includes a screening module (not shown in the figure), which is used to: before calculating the correlation between the search address and each address in the pre-acquired candidate address data, obtain the secondary administrative district of the search address, and filter out regional address data that is consistent with the secondary administrative district of the search address from the candidate address data; the related address acquisition module 502 is also used to: calculate the correlation between the search address and each address in the regional address data.
[0084] According to another embodiment of the present invention, the related address acquisition module 502 is further used to: obtain a detailed address without administrative district information in the search address by structurally splitting the text of the search address; perform word segmentation processing on the detailed address to obtain a search word segmentation list; and calculate the text relevance score of each address in the search word segmentation list and the regional address data through a word frequency scoring algorithm.
[0085] According to yet another embodiment of the present invention, the recalled address acquisition module 503 is further used to: use a pre-built spatial distance prediction model to calculate the spatial distance score between the search address and each address in the related address data.
[0086] According to another embodiment of the present invention, the spatial distance prediction model is constructed in the following manner: an address with positioning coordinates is selected as a retrieval training address, and according to the positioning coordinates, a corresponding adjacent training address is determined to obtain a training sample; vector encoding is performed on the retrieval training address and the adjacent training address respectively to obtain a retrieval address vector and an adjacent address vector; the retrieval address vector and the adjacent address vector are input into a multi-head attention text understanding module in a preset spatial distance prediction initial model to obtain a retrieval first position vector and an adjacent first position vector; the retrieval first position vector and the adjacent first position vector are then passed through a vector splicing module, a forward neural network and a linear network in the spatial distance prediction initial model to obtain a predicted spatial distance between the retrieval training address and the adjacent training address; according to the predicted spatial distance and the actual spatial distance between the retrieval training address and the adjacent training address, the spatial distance prediction initial model is trained by back propagation and gradient descent algorithm using a mean square error loss function to obtain a spatial distance prediction model.
[0087] According to another embodiment of the present invention, the address data recall device 500 also includes a speed-up module (not shown in the figure), which is used to: use a pre-built spatial distance prediction model to calculate the spatial distance score between the retrieval address and each address in the related address data, and then use the multi-head attention text understanding module in the pre-built spatial distance prediction model to calculate the address first position vector of each address in the related address data; the recall address acquisition module 503 is also used to: use the multi-head attention text understanding module in the spatial distance prediction model to calculate the retrieval first position vector of the retrieval address; according to the retrieval first position vector and the address first position vector, use the vector splicing module, forward neural network and linear network in the spatial distance prediction model to obtain the spatial distance score between the retrieval address and each address in the related address data.
[0088] According to another embodiment of the present invention, the address data recall device 500 also includes a plug-in construction module (not shown in the figure), which is used to: integrate the spatial distance prediction model into a search engine-based spatial distance scoring plug-in, so as to calculate the spatial distance score between the retrieved address and each address in the related address data through the spatial distance scoring plug-in.
[0089] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.
[0090] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0091] Users can use terminal devices 601, 602, 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, 603, such as address data recall applications, etc. (only for example).
[0092] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0093] The server 605 may be a server that provides various services, such as a background management server that provides support for address data performed by users using terminal devices 601, 602, and 603 (only as an example). In response to receiving an address data recall request, the background management server may obtain a search address input by a user; calculate the relevance between the search address and each address in the candidate address data obtained in advance, and select relevant address data from the candidate address data according to the calculation result of the relevance; calculate the spatial distance between the search address and each address in the relevant address data, and select the recalled address data corresponding to the search address from the relevant address data according to the calculation result of the spatial distance, and feed back the processing result (such as the recalled address data, etc. - only as an example) to the terminal device.
[0094] It should be noted that the method for recalling address data provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device for recalling address data is generally disposed in the server 605 .
[0095] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0096] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0097] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0098] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0099] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0100] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.
[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0102] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes: a retrieval address acquisition module, a related address acquisition module and a recall address acquisition module.
[0103] The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the retrieval address acquisition module can also be described as "a module for acquiring a retrieval address input by a user in response to receiving an address data recall request."
[0104] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by a device, the device includes: in response to receiving an address data recall request, obtaining a search address input by a user; calculating the correlation between the search address and each address in the pre-acquired candidate address data, and selecting relevant address data from the candidate address data according to the calculation result of the correlation; calculating the spatial distance between the search address and each address in the relevant address data, and selecting the recall address data corresponding to the search address from the relevant address data according to the calculation result of the spatial distance.
[0105] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by responding to receiving an address data recall request, obtaining a search address input by a user; calculating the correlation between the search address and each address in the pre-acquired candidate address data, and selecting relevant address data from the candidate address data according to the calculation result of the correlation; calculating the spatial distance between the search address and each address in the relevant address data, and selecting the recalled address data corresponding to the search address from the relevant address data according to the calculation result of the spatial distance. The technical solution realizes a high-precision address data recall method, incorporates the spatial distance factor between addresses into the recall strategy, comprehensively considers the correlation of addresses and the spatial distance of addresses, improves the accuracy of address data recall, and thus provides users with better geocoding services.
[0106] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for recalling address data, characterized in that: include: In response to receiving the address data recall request, obtaining a search address input by a user; Calculating the relevance between the search address and each address in the pre-acquired candidate address data, and selecting relevant address data from the candidate address data according to the calculation result of the relevance; The spatial distance between the search address and each address in the related address data is calculated, and according to the calculation result of the spatial distance, the recalled address data corresponding to the search address is selected from the related address data.
2. The method according to claim 1, characterized in that Before calculating the relevance between the search address and each address in the pre-acquired candidate address data, the method further includes: Obtaining the secondary administrative district of the search address, and filtering out regional address data consistent with the secondary administrative district of the search address from the candidate address data; Calculating the correlation between the search address and each address in the pre-acquired candidate address data includes: calculating the correlation between the search address and each address in the area address data.
3. The method according to claim 2, characterized in that Calculating the relevance between the search address and each address in the regional address data includes: By structurally splitting the text of the search address, a detailed address without administrative district information in the search address is obtained; Perform word segmentation processing on the detailed address to obtain a search word segmentation list; The text relevance score of each address in the search word segmentation list and the regional address data is calculated by a word frequency scoring algorithm.
4. The method according to claim 1, characterized in that: Calculating the spatial distance between the search address and each address in the related address data includes: The spatial distance scores between the search address and each address in the related address data are calculated using a pre-built spatial distance prediction model.
5. The method according to claim 4, characterized in that The spatial distance prediction model is constructed in the following way: Selecting an address with positioning coordinates as a retrieval training address, and determining a corresponding adjacent training address according to the positioning coordinates to obtain a training sample; Performing vector encoding on the retrieval training address and the adjacent training address respectively to obtain a retrieval address vector and an adjacent address vector; Input the retrieval address vector and the adjacent address vector into a multi-head attention text understanding module in a preset spatial distance prediction initial model to obtain a retrieval first position vector and an adjacent first position vector; then pass the retrieval first position vector and the adjacent first position vector through a vector concatenation module, a forward neural network and a linear network in the spatial distance prediction initial model to obtain a predicted spatial distance between the retrieval training address and the adjacent training address; According to the predicted spatial distance and the actual spatial distance between the retrieved training address and the adjacent training address, the spatial distance prediction initial model is trained by back propagation and gradient descent algorithm using a mean square error loss function to obtain a spatial distance prediction model.
6. The method according to claim 5, characterized in that Before calculating the spatial distance scores between the search address and each address in the related address data using the pre-built spatial distance prediction model, the method further includes: calculating the address head position vector of each address in the related address data using the multi-head attention text understanding module in the pre-built spatial distance prediction model; Using a pre-built spatial distance prediction model, the spatial distance scores between the search address and each address in the related address data are calculated, including: using the multi-head attention text understanding module in the spatial distance prediction model to calculate the search first position vector of the search address; based on the search first position vector and the address first position vector, using the vector splicing module, forward neural network and linear network in the spatial distance prediction model to obtain the spatial distance scores between the search address and each address in the related address data.
7. The method according to claim 4, characterized in that The method further comprises: The spatial distance prediction model is integrated into a search engine-based spatial distance scoring plug-in, so as to calculate the spatial distance scores between the search address and each address in the related address data through the spatial distance scoring plug-in.
8. A device for recalling address data, characterized in that: include: A search address acquisition module, configured to acquire a search address input by a user in response to receiving an address data recall request; A related address acquisition module, used to calculate the correlation between the search address and each address in the pre-acquired candidate address data, and select the related address data from the candidate address data according to the calculation result of the correlation; The recall address acquisition module is used to calculate the spatial distance between the search address and each address in the related address data, and select the recall address data corresponding to the search address from the related address data according to the calculation result of the spatial distance.
9. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Address data processing method and geocoding method
CN121478832A
