Address query method and system, electronic equipment and product
By vectorized processing and comprehensive similarity calculation of user input addresses, the difficulty of identifying spoken and fuzzy address data by address query methods in the prior art is solved, and a higher query accuracy and speed is achieved.
Patent Information
- Application Number
- CN202510340521.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-03-21
AI Technical Summary
When existing address query methods process colloquial and fuzzy address data entered by users, especially in spelling errors, abbreviations and common names, it is difficult to accurately identify and match, resulting in inaccurate or failure of query results.
The address data input by the user is processed using vectorization, and the text similarity with the candidate sample address data in the geocoding database is calculated, and the target address data is determined by comprehensive similarity calculation.
It improves the accuracy and speed of address query, can effectively handle address query needs in complex scenarios, and improves user experience.
Smart Images

Figure CN120407958A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of geographic information services, and particularly relates to an address query method, system, electronic device and product. Background Art
[0002] In application scenarios such as vehicle navigation, food delivery, and express logistics, it is usually necessary to perform precise address queries based on the original address data input by users in order to meet the subsequent needs of navigation guidance. The existing address query methods mainly include query methods based on string matching and query methods based on keyword search. Among them, the query method based on string matching usually relies on database indexes (such as B-Tree, Hash index) to query address fields; the query method based on keyword search uses an inverted index to segment the address text and stores it in the index library for subsequent address queries based on the index library.
[0003] The above-mentioned existing technologies can meet the address query requirements to a certain extent. However, during the use of the existing technologies, the inventor found that there are at least the following problems in the existing technologies: The original address data input by users often has problems such as colloquialism and ambiguity, and may include spelling mistakes, abbreviations, and common names. The address fuzzy matching capabilities of traditional string matching and keyword search methods are insufficient and it is difficult to effectively process them. For example, "Wangjing Xiyuan Fourth District, Chaoyang District, Beijing" may be input by users as "Wangjing Xisi", and it is difficult to correctly identify it using the existing matching methods, resulting in inaccurate query results or query failures. Summary of the Invention
[0004] The present invention aims to solve the above technical problems at least to a certain extent, and provides an address query method, system, electronic device and product.
[0005] To achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides an address query method, including: Receiving an address query request bound with original address data, and performing vectorization processing on the original address data to obtain vectorized address data to be queried; Extracting candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculating the text similarity between each candidate sample address data and the vectorized address data to be queried respectively to obtain the text similarity between each candidate sample address data and the vectorized address data to be queried; wherein, coordinate data is mapped to the candidate sample address data in the geocoding database; Extract the maximum text similarity value from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determine whether the maximum text similarity value is greater than the first similarity threshold. If so, use the candidate sample address data corresponding to the maximum text similarity value as the target address data that matches the original address data; if not, proceed to the next step; Extract the m candidate sample address data with the highest text similarity to the vectorized address data to be queried from each candidate sample address data, and set them as the pre-matched sample address data; where m is a natural number greater than 1; Perform address prediction processing on the vectorized address data to be queried based on the text similarities between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, to obtain the coordinate prediction data of the vectorized address data to be queried; Calculate the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address data to be queried, to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address data to be queried; Obtain the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried based on the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address data to be queried; Extract the target address data that matches the original address data from each pre-matched sample address data according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried.
[0006] In a possible design, the vectorization process of the original address data to obtain the vectorized address data to be queried includes: Preprocess the original address data to obtain the preprocessed address data to be queried; Perform structured parsing on the preprocessed address data to be queried using natural language processing methods to obtain the structured address data to be queried; Perform vectorization on the structured address data to be queried to obtain the vectorized address data to be queried.
[0007] In a possible design, the text similarity between the l th candidate sample address data and the vectorized address data to be queried is: ; In the formula, V q represents the vectorized address data to be queried, Vl Represents any one of the candidate sample address data.
[0008] In a possible design, the coordinate prediction data of the vectorized address data to be queried is: ( φ q , λ q ); Wherein, φ q is the latitude of the coordinate prediction data of the vectorized address data to be queried, , is the text similarity between the i-th pre-matched sample address data and the vectorized address data to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data; λ q is the longitude of the coordinate prediction data of the vectorized address data to be queried, , λ i is the longitude of the coordinate data corresponding to the i-th pre-matched sample address data.
[0009] In a possible design, the geographical distance similarity between the i -th pre-matched sample address data and the vectorized address data to be queried is: ; In the formula, d is the spherical distance between the coordinate prediction data of the vectorized address data to be queried and the coordinate data corresponding to the i -th pre-matched sample address data, , R is the radius of the earth, φ q is the latitude of the coordinate prediction data of the vectorized address data to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data, , ; is a preset attenuation factor.
[0010] In a possible design, the comprehensive similarity between the i -th pre-matched sample address data and the vectorized address data to be queried is: S final = α * S t,i +β * S g,i ; Wherein, S t,i is the text similarity between the i th pre-matched sample address data and the vectorized address data to be queried, α is the preset text importance weight, S g,i is the i th geographical distance similarity between the pre-matched sample address data and the vectorized address data to be queried, β is the preset geographical distance importance weight.
[0011] In a possible design, according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried, the target address data matching the original address data is extracted from each pre-matched sample address data, including: Extract the maximum value of the comprehensive similarity from the comprehensive similarities between each pre-matched sample address data and the vectorized address data to be queried; Determine whether the maximum value of the comprehensive similarity is greater than a preset second similarity threshold. If so, use the pre-matched sample address data corresponding to the maximum value of the comprehensive similarity as the target address data matching the original address data; if not, proceed to the next step; Extract the n pre-matched sample address data with the largest comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried, and then output an address selection request bound to the current n pre-matched sample address data, so as to receive an address selection instruction bound to any one of the current n pre-matched sample address data fed back by the user, and then use the current any one of the pre-matched sample address data as the target address data; where n is a natural number greater than 1 and less than or equal to m.
[0012] In a second aspect, the present invention provides an address query system, including: A vectorization processing module, configured to receive an address query request bound with original address data, and perform vectorization processing on the original address data to obtain vectorized address data to be queried; The first similarity calculation module, which is communicatively connected to the vectorization processing module, is configured to extract candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculate the text similarity between each candidate sample address data and the vectorized address data to be queried, so as to obtain the text similarity between each candidate sample address data and the vectorized address data to be queried; wherein, the candidate sample address data in the geocoding database is mapped with coordinate data; The first similarity calculation module is further configured to extract the maximum text similarity from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determine whether the maximum text similarity is greater than a first similarity threshold. If so, the candidate sample address data corresponding to the maximum text similarity is used as the target address data matching the original address data; if not, m candidate sample address data with the greatest text similarity between each candidate sample address data and the vectorized address data to be queried are extracted and set as pre-matched sample address data; where m is a natural number greater than 1; The coordinate prediction module, which is communicatively connected to the first similarity calculation module, is configured to perform address prediction processing on the vectorized address data to be queried according to the text similarities between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, so as to obtain the coordinate prediction data of the vectorized address data to be queried; The second similarity calculation module, which is communicatively connected to the coordinate prediction module, is configured to calculate the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address data to be queried, so as to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address data to be queried; The comprehensive similarity calculation module, which is communicatively connected to the second similarity calculation module, is configured to obtain the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried according to the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address data to be queried; and is further configured to extract the target address data matching the original address data from each pre-matched sample address data according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried.
[0013] In a third aspect, the present invention provides an electronic device, including: A memory for storing computer program instructions; and, A processor for executing the computer program instructions to complete the operations of an address query method as described in any one of the above.
[0014] In a fourth aspect, the present invention provides a computer program product, including a computer program or instructions, which, when executed by a computer, implement an address query method as described in any one of the above.
[0015] The beneficial effects of the present invention are as follows: The present invention discloses an address query method, system, electronic device and product, which can improve the accuracy of address query. Specifically, in the implementation process of the present invention, the original address data input by the user is pre-vectorized to obtain vectorized address data to be queried. Subsequently, the text similarity between the vectorized address data to be queried and the candidate sample address data extracted from the address coding database is calculated. When the maximum value of the text similarity is greater than the first similarity threshold, the candidate sample address data corresponding to the maximum value of the text similarity is used as the target address data matching the original address data. Otherwise, the m candidate sample address data with the highest text similarity are used as pre-matched sample address data. Then, the geographical distance similarity and comprehensive similarity between the vectorized address data to be queried and each pre-matched sample address data are calculated in turn, and based on each comprehensive similarity, the target address data matching the original address data is extracted from each pre-matched sample address data. Based on this, when the text similarity is high enough, the present invention directly performs address matching without calculating the geographical location similarity. Otherwise, the top m pre-matched sample address data with the highest text similarity are extracted, and the geographical location similarity is further calculated, and the target address data matching the original address data is obtained according to the final comprehensive similarity. Thereby, the accuracy of address query is improved, and at the same time, the matching speed and matching accuracy can be taken into account, avoiding redundant calculations when the text similarity is high, and ensuring that the geographical distance similarity can be combined for matching optimization when the text matching degree is low; in addition, the present invention can effectively support address query requirements in a variety of complex scenarios and improve the user experience.
[0016] Other beneficial effects of the present invention will be further described in the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of the address query method in Embodiment 1; Figure 2 is a block diagram of the address query system in Embodiment 2; Figure 3 is a block diagram of the electronic device in Embodiment 3. SPECIFIC IMPLEMENTATION MANNER
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the present invention in combination with the accompanying drawings and the description of the embodiments or the prior art. Obviously, the following description of the structures of the accompanying drawings is only some embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts. It should be noted here that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation to the present invention.
[0019] Embodiment 1: This embodiment discloses an address query method, which can be, but is not limited to, executed by a computer device or a virtual machine with certain computing resources, such as executed by an electronic device such as a personal computer, a smart phone, a personal digital assistant or a wearable device, or executed by a virtual machine.
[0020] As Figure 1 shown, an address query method can, but is not limited to, include the following steps: S1. Receive an address query request bound with original address data input by a user, and perform vectorization processing on the original address data to obtain vectorized address data to be queried.
[0021] Specifically, in step S1 of this embodiment, performing vectorization processing on the original address data to obtain vectorized address data to be queried includes: S101. Perform preprocessing on the original address data to obtain preprocessed address data to be queried; it should be understood that in this embodiment, the original address data is an address string. In this embodiment, preprocessing of the original address data is achieved by means such as format normalization (such as removing spaces, punctuation marks and converting cases), synonym replacement (such as converting "Avenue" to "Street") and spelling correction (such as correction based on edit distance, Soundex).
[0022] S102. Structurally parse the preprocessed address data to be queried using natural language processing methods to obtain structured address data to be queried. Specifically, in this embodiment, but not limited to, NLP models such as BERT (Bidirectional Encoder Representations from Transformers), TextRank (a graph-based ranking algorithm), and Seq2Seq (Sequence-to-Sequence) can be used to perform address word segmentation on the preprocessed address data to be queried, and further perform syntax parsing. The structured address data to be queried includes address components such as province, city, district, street, and house number. Thus, the problems of spelling mistakes and semantic ambiguities in the preprocessed address data to be queried can be eliminated, which is beneficial to improving the subsequent fuzzy matching ability. As an example, if the preprocessed address data to be queried is "Beijing Chaoyang SOHO Modern City", the structured address data to be queried obtained after structural parsing is {Province: Beijing City, Region: Chaoyang District, Landmark: SOHO Modern City}.
[0023] S103. Vectorize the structured address data to be queried to obtain vectorized address data to be queried. Specifically, in this embodiment, but not limited to, models such as BERT or Word2Vec (a technique for mapping words to a continuous vector space) can be used to convert the structured address data to be queried into high-dimensional address vectors, and further perform normalization processing to make address vectors of different lengths within the same scale range. Thus, it is beneficial to improve the subsequent address retrieval efficiency. As an example, if the structured address data to be queried is {Province: Beijing City, Region: Chaoyang District, Landmark: SOHO Modern City}, the vectorized address data to be queried obtained after vectorization is V q =(0.12, −0.45, 0.78, …, 0.88).
[0024] Specifically, in this embodiment, through the above steps S101 - S103, before performing data vectorization processing, preprocessing and structural parsing processing are performed in advance, which can improve the data quality for address query, and further improve the subsequent address query accuracy and speed.
[0025] S2. Extract candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculate the text similarity between each candidate sample address data and the vectorized address data to be queried respectively; wherein, coordinate data is mapped to the candidate sample address data in the geocoding database.
[0026] It should be noted that in this embodiment, multiple sample address data are stored in the geocoding database. The sample address data can also be referred to as standard address data, which are standardized address data that have been preprocessed, structurally parsed, and vectorized. Each sample address data is mapped with a coordinate data respectively, forming the basic data for users to perform address retrieval and matching. During the implementation of this embodiment, the text similarity matching and geographical distance similarity matching of the vectorized address data to be queried can be achieved simultaneously through the geocoding database, thereby avoiding the result error caused by relying solely on text matching.
[0027] It should also be noted that in step S2, when calculating the text similarity, theoretically, it is necessary to calculate the text similarity between all the sample address data in the geocoding database and the vectorized address data to be queried input by the user. However, since the amount of address data in the geocoding database may be extremely large (millions or even hundreds of millions of records), the overhead of direct brute-force calculation is extremely high. Therefore, in practical applications of this embodiment, efficient indexing and retrieval methods are usually used to extract candidate sample address data from the geocoding database to accelerate the matching. Specifically, in step S2, extracting candidate sample address data from a preset geocoding database according to the vectorized address data to be queried includes: S201. Split the sample address data in the geocoding database into keywords, and establish an inverted index based on the keywords of each sample address data; it should be noted that the inverted index is a data structure for fast text retrieval, which stores the mapping relationship from words to the documents (or address records) containing these words. In address matching, the inverted index is used to help quickly find the standard address records containing specific keywords.
[0028] S202. Perform word segmentation on the original address data to obtain multiple keywords to be queried, and filter the inverted index to obtain multiple candidate sample address data. For example, if the text data corresponding to any sample address data is "SOHO Modern City, Chaoyang District, Beijing", its corresponding keywords include: Beijing, Chaoyang, SOHO, Modern City, and Building A. When the original address data input by the user is "SOHO Modern City, Chaoyang District, Beijing", the established inverted index can be used to find sample address data containing Beijing, Chaoyang, SOHO, and Modern City, and then filter to obtain multiple candidate sample address data including any of the above sample address data.
[0029] It should be noted that in this embodiment, after obtaining the vectorized address data to be queried, an inverted index is first used to quickly filter out potentially relevant standard address data from the geocoding database and use this data as candidate sample address data. This significantly reduces the number of addresses requiring subsequent text similarity calculations. The candidate sample address data can also be further screened using methods such as ANN approximate nearest neighbor search. Based on this, this embodiment can significantly reduce the amount of text similarity calculations while ensuring query speed and matching accuracy. Even if the geocoding database is very large (consisting of hundreds of millions of address data), text similarity calculations can be completed quickly, thereby improving address matching efficiency.
[0030] In step S2, the text similarity adopts cosine similarity. Specifically, the first l The text similarity between the candidate sample address data and the vectorized address data to be queried is: ; Where, V q represents the vectorized address data to be queried, V l It should be understood that l is a natural number greater than 0 and less than or equal to the total amount of candidate sample address data.
[0031] It should be noted that, in this embodiment, the text similarity adopts cosine similarity, which is suitable for the case where the text length is inconsistent. For example, "Block A, SOHO Modern City, Chaoyang District, Beijing" and "Block A, SOHO Modern City" can still obtain a high similarity. At the same time, the cosine similarity is used for address matching, which has a faster calculation speed and is suitable for large-scale retrieval tasks.
[0032] S3. Extract the maximum text similarity from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determine whether the maximum text similarity is greater than the first similarity threshold. If so, use the candidate sample address data corresponding to the maximum text similarity as the target address data that matches the original address data; if not, proceed to the next step, that is, step S4. As an example, the first similarity threshold is 0.9. If the text similarity between a certain candidate sample address data and the vectorized address data to be queried is the largest and the text similarity is greater than the first similarity threshold, it indicates that its matching degree with the original address data input by the user is extremely high. At this time, it can be directly used as the target address data, thereby improving the address matching speed when the normalization degree of the original address data input by the user is relatively high.
[0033] S4. Extract the m candidate sample address data with the largest text similarity between each candidate sample address data and the vectorized address data to be queried, and set them as the pre-matched sample address data; where m is a natural number greater than 1.
[0034] S5. Perform address prediction processing on the vectorized address data to be queried according to the text similarities between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, to obtain the coordinate prediction data of the vectorized address data to be queried. It should be noted that the original address data input by the user usually does not include address data. In order to simulate the potential geographical location of the original address data, in this embodiment, the coordinate data of the m pre-matched sample address data are weighted and averaged to obtain the coordinate prediction data for subsequent geographical location matching.
[0035] In step S5, the coordinate prediction data of the vectorized address data to be queried is: ( φ q , λ q ); where, φ q is the latitude of the coordinate prediction data of the vectorized address data to be queried, , is the text similarity between the i-th pre-matched sample address data and the vectorized address data to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data; λ q is the longitude of the coordinate prediction data of the vectorized address data to be queried, , λi is the longitude of the coordinate data corresponding to the i-th pre-matched sample address data.
[0036] S6. Calculate the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address to be queried, to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address to be queried.
[0037] In step S6, the i geographical distance similarity between the i-th pre-matched sample address data among the m pre-matched sample address data and the vectorized address to be queried is: ; In the formula, d is the spherical distance between the coordinate prediction data of the vectorized address to be queried and the coordinate data corresponding to the i i-th pre-matched sample address data, , R is the radius of the earth. In this embodiment, R is taken as 6371 km, φ q is the latitude of the coordinate prediction data of the vectorized address to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data, , that is is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data φ i and the latitude φ q of the coordinate prediction data of the vectorized address to be queried, , that is is the longitude of the coordinate data corresponding to the i-th pre-matched sample address data λ i and the longitude λ q of the coordinate prediction data of the vectorized address to be queried; is a preset attenuation factor. As an example, is set to 500 m.
[0038] S7. Obtain the comprehensive similarity between each pre-matched sample address data and the vectorized address to be queried according to the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address to be queried.
[0039] In step S7, the comprehensive similarity between the i i-th pre-matched sample address data and the vectorized address to be queried is: S final = α * S t,i + β * S g,i ; Wherein, S t,i is the text similarity between the i th pre-matching sample address data and the vectorized address data to be queried, α is the preset text importance weight, S g,i is the i th geographical distance similarity between the pre-matching sample address data and the vectorized address data to be queried, β is the preset geographical distance importance weight. As an example, in this embodiment, α = 0.7, β = 0.3.
[0040] S8. Extract the target address data matching the original address data from each pre-matching sample address data according to the comprehensive similarity between each pre-matching sample address data and the vectorized address data to be queried.
[0041] Specifically, in step S8, extracting the target address data matching the original address data from each pre-matching sample address data according to the comprehensive similarity between each pre-matching sample address data and the vectorized address data to be queried includes: S801. Extract the maximum value of the comprehensive similarity from the comprehensive similarities between each pre-matching sample address data and the vectorized address data to be queried; S802. Determine whether the maximum value of the comprehensive similarity is greater than a preset second similarity threshold. If so, use the pre-matching sample address data corresponding to the maximum value of the comprehensive similarity as the target address data matching the original address data; if not, proceed to the next step. By way of example, in this embodiment, the value of the second similarity threshold is 0.8, that is, when the maximum value of the comprehensive similarity between each pre-matching sample address data and the vectorized address data to be queried is greater than 0.8, select the pre-matching sample address data with the maximum comprehensive similarity as the target address data, otherwise provide multiple alternative pre-matching sample address data for the user to select.
[0042] Extract n pre-matched sample address data with the largest comprehensive similarity with the vectorized address data to be queried from each pre-matched sample address data, and then output an address selection request bound to the current n pre-matched sample address data, so as to receive an address selection instruction bound to any one of the current n pre-matched sample address data fed back by the user, and then use any one of the current pre-matched sample address data as the target address data; where n is a natural number greater than 1 and less than or equal to m. It should be noted that if the maximum value of the comprehensive similarity is not greater than a preset second similarity threshold, when outputting the address selection request to the user, a prompt message related to address input error can also be output to the user, so that the user can check the input data, and can re-enter the original address data into the system when it is confirmed that the input is incorrect.
[0043] This embodiment can improve the accuracy of address query. Specifically, in the implementation process of this embodiment, the original address data input by the user is pre-vectorized to obtain vectorized address data to be queried, and then the text similarity between the vectorized address data to be queried and the candidate sample address data extracted from the address coding database is calculated. When the maximum value of the text similarity is greater than the first similarity threshold, the candidate sample address data corresponding to the maximum value of the text similarity is used as the target address data matching the original address data. Otherwise, the m candidate sample address data with the largest text similarity are used as pre-matched sample address data, and then the geographical distance similarity and comprehensive similarity between the vectorized address data to be queried and each pre-matched sample address data are calculated in turn, and based on each comprehensive similarity, the target address data matching the original address data is extracted from each pre-matched sample address data. Based on this, when the text similarity is high enough (exceeding the first similarity threshold), this embodiment directly performs address matching without calculating the geographical location similarity. Otherwise, the first m pre-matched sample address data with the highest text similarity are extracted, and the geographical location similarity is further calculated, and the target address data matching the original address data is obtained according to the final comprehensive similarity, thereby improving the accuracy of address query, while taking into account the matching speed and matching accuracy, avoiding redundant calculations when the text similarity is high, and ensuring that the geographical distance similarity can be combined for matching optimization when the text matching degree is low; in addition, this embodiment can effectively support address query requirements in a variety of complex scenarios and improve the user experience.
[0044] Embodiment 2: This embodiment discloses an address query system for implementing the address query method in Embodiment 1; as Figure 2 shown, the address query system includes: A vectorization processing module, configured to receive an address query request bound with original address data, and perform vectorization processing on the original address data to obtain vectorized address data to be queried; A first similarity calculation module, communicatively connected to the vectorization processing module, configured to extract candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculate the text similarity between each candidate sample address data and the vectorized address data to be queried respectively, to obtain the text similarity between each candidate sample address data and the vectorized address data to be queried; wherein, the candidate sample address data in the geocoding database is mapped with coordinate data; The first similarity calculation module is further configured to extract the maximum text similarity from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determine whether the maximum text similarity is greater than a first similarity threshold. If so, the candidate sample address data corresponding to the maximum text similarity is used as the target address data matching the original address data; if not, m candidate sample address data with the largest text similarity between each candidate sample address data and the vectorized address data to be queried are extracted and set as pre-matched sample address data; wherein, m is a natural number greater than 1; A coordinate prediction module, communicatively connected to the first similarity calculation module, configured to perform address prediction processing on the vectorized address data to be queried according to the text similarities between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, to obtain coordinate prediction data of the vectorized address data to be queried; A second similarity calculation module, communicatively connected to the coordinate prediction module, configured to calculate the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address data to be queried respectively, to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address data to be queried; An integrated similarity calculation module, communicatively connected to the second similarity calculation module, configured to obtain the integrated similarity between each pre-matched sample address data and the vectorized address data to be queried according to the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address data to be queried; and is further configured to extract the target address data matching the original address data from each pre-matched sample address data according to the integrated similarity between each pre-matched sample address data and the vectorized address data to be queried.
[0045] It should be noted that for the working process, working details and technical effects of the address query system provided in this Embodiment 2, reference can be made to Embodiment 1, which will not be elaborated herein.
[0046] Embodiment 3: Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. The electronic device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc. As Figure 3 shown, the electronic device includes: a memory for storing computer program instructions; and, a processor for executing the computer program instructions to complete the operations of an address query method as described in any one of Embodiment 1.
[0047] Specifically, the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen.
[0048] The memory 302 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 302 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 301 to implement the address query method provided in Embodiment 1 of the present application.
[0049] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302, and the communication interface 303 may be connected via a bus or signal lines. Each peripheral device may be connected to the communication interface 303 via a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 304, a display screen 305, and a power supply 306.
[0050] The communication interface 303 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.
[0051] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals.
[0052] The display screen 305 is used to display a UI (User Interface). The UI may include any combination of graphics, text, icons, and videos.
[0053] The power supply 306 is used to supply power to each component in the electronic device.
[0054] Embodiment 4: Based on any one of Embodiments 1 to 3, this embodiment discloses a computer program product, including a computer program or instructions, and the computer program or the instructions, when executed by a computer, implement an address query method as described in any one of Embodiments 1. Wherein, the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0055] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.
[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An address query method, characterized in that, Including: Receiving an address query request bound with original address data, and performing vectorization processing on the original address data to obtain vectorized address data to be queried; Extracting candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculating the text similarity between each candidate sample address data and the vectorized address data to be queried respectively, to obtain the text similarity between each candidate sample address data and the vectorized address data to be queried; wherein, the candidate sample address data in the geocoding database is mapped with coordinate data; Extracting the maximum value of the text similarity from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determining whether the maximum value of the text similarity is greater than a first similarity threshold. If so, using the candidate sample address data corresponding to the maximum value of the text similarity as the target address data matching the original address data; if not, proceeding to the next step; Extracting the m candidate sample address data with the largest text similarity with the vectorized address data to be queried from each candidate sample address data, and setting them as pre-matched sample address data; wherein, m is a natural number greater than 1; Performing address prediction processing on the vectorized address data to be queried according to the text similarity between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, to obtain coordinate prediction data of the vectorized address data to be queried; Calculating the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address data to be queried respectively, to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address data to be queried; Obtaining the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried according to the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address data to be queried; Extracting the target address data matching the original address data from each pre-matched sample address data according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried.
2. The address query method according to claim 1, wherein Performing vectorization processing on the original address data to obtain vectorized address data to be queried, including: Performing preprocessing on the original address data to obtain preprocessed address data to be queried; Performing structured parsing processing on the preprocessed address data to be queried by using a natural language processing method to obtain structured address data to be queried; Performing vectorization processing on the structured address data to be queried to obtain vectorized address data to be queried.
3. The address query method according to claim 1, wherein The l text similarity between the candidate sample address data and the vectorized address data to be queried is as follows: ; In the formula, V q represents the vectorized address data to be queried, V l represents any one of the candidate sample address data.
4. The address query method according to claim 1, wherein The coordinate prediction data of the vectorized address data to be queried is: ( φ q , λ q ); Among them, φ q is the latitude of the coordinate prediction data of the vectorized address data to be queried, , is the text similarity between the i-th pre-matched sample address data and the vectorized address data to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data; λ q is the longitude of the coordinate prediction data of the vectorized address data to be queried, , λ i is the longitude of the coordinate data corresponding to the i-th pre-matched sample address data.
5. The address query method according to claim 4, wherein The i geographical distance similarity between the first pre-matched sample address data and the vectorized address data to be queried is: ; Wherein, d is the spherical distance between the coordinate prediction data of the vectorized address data to be queried and the coordinate data corresponding to the i th pre-matched sample address data, , R is the radius of the earth, φ q is the latitude of the coordinate prediction data of the vectorized address data to be queried, φ i is the latitude of the coordinate data corresponding to the i-th pre-matched sample address data, , ; is a preset attenuation factor.
6. The address query method according to claim 1, wherein The i comprehensive similarity between the pre-matched sample address data and the vectorized address data to be queried is: S final = α * S t,i + β * S g,i ; In the formula, S t,i is the text similarity between the i th pre-matched sample address data and the vectorized address data to be queried, α is the preset text importance weight, S g,i is the i th geographical distance similarity between the pre-matched sample address data and the vectorized address data to be queried, β is the preset geographical distance importance weight.
7. The address query method according to claim 1, characterized in that Extracting the target address data matching the original address data from each pre-matched sample address data according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried, including: Extract the maximum comprehensive similarity from the comprehensive similarities between each pre-matched sample address data and the vectorized address data to be queried; Determine whether the maximum comprehensive similarity is greater than a preset second similarity threshold. If so, use the pre-matched sample address data corresponding to the maximum comprehensive similarity as the target address data that matches the original address data; if not, proceed to the next step; Extract the n pre-matched sample address data with the maximum comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried, and then output an address selection request bound to the current n pre-matched sample address data, so as to receive an address selection instruction bound to any one of the current n pre-matched sample address data fed back by the user, and then use any one of the current pre-matched sample address data as the target address data; where n is a natural number greater than 1 and less than or equal to m.
8. An address query system, characterized in that, Includes: A vectorization processing module, configured to receive an address query request bound to the original address data, and perform vectorization processing on the original address data to obtain vectorized address data to be queried; A first similarity calculation module, communicatively connected to the vectorization processing module, configured to extract candidate sample address data from a preset geocoding database according to the vectorized address data to be queried, and calculate the text similarity between each candidate sample address data and the vectorized address data to be queried respectively, to obtain the text similarity between each candidate sample address data and the vectorized address data to be queried; wherein, the candidate sample address data in the geocoding database is mapped with coordinate data; The first similarity calculation module is further configured to extract the maximum text similarity from the text similarities between each candidate sample address data and the vectorized address data to be queried, and determine whether the maximum text similarity is greater than the first similarity threshold. If so, use the candidate sample address data corresponding to the maximum text similarity as the target address data that matches the original address data; if not, extract the m candidate sample address data with the maximum text similarity between each candidate sample address data and the vectorized address data to be queried, and set them as pre-matched sample address data; where m is a natural number greater than 1; A coordinate prediction module, communicatively connected to the first similarity calculation module, configured to perform address prediction processing on the vectorized address data to be queried according to the text similarities between each pre-matched sample address data and the vectorized address data to be queried, and the coordinate data corresponding to each pre-matched sample address data, to obtain coordinate prediction data of the vectorized address data to be queried; A second similarity calculation module, communicatively connected to the coordinate prediction module, configured to calculate the geographical distance similarity between the coordinate data corresponding to each pre-matched sample address data and the coordinate prediction data of the vectorized address data to be queried respectively, to obtain the geographical distance similarity between each pre-matched sample address data and the vectorized address data to be queried; The comprehensive similarity calculation module, communicatively connected to the second similarity calculation module, is configured to obtain the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried according to the geographical distance similarity and text similarity between each pre-matched sample address data and the vectorized address data to be queried; and is further configured to extract, according to the comprehensive similarity between each pre-matched sample address data and the vectorized address data to be queried, the target address data that matches the original address data from each pre-matched sample address data.
9. An electronic device, characterized in that, It includes: a memory for storing computer program instructions; and a processor for executing the computer program instructions to complete the operations of an address query method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or the instructions, when executed by a computer, implement an address query method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Address query method, method for obtaining address vector representation model and corresponding device
CN114579883A
Address positioning method and device, electronic equipment and storage medium
CN117312478A
Address searching method and device, equipment and storage medium
CN117349540A
Address text query method, electronic equipment and computer readable storage medium
CN117828011A
Location influenced search results
US20070061302A1