Accurate self-matching method and system based on address search

By optimizing the address query system through regular expressions and dynamic vocabulary, the problems of complex address formats and static vocabulary limitations are solved, and invalid addresses and entries are effectively handled, which improves the accuracy and efficiency of queries. It is suitable for real-time query scenarios that process large amounts of address data.

CN120723804APending Publication Date: 2025-09-30DATANG SOFTWARE TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510650020.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing address query systems have difficulty processing complex and non-standardized address formats. Static lexicons limit the system's flexibility and accuracy in processing new or rare addresses. Insufficient processing of invalid addresses and entries leads to reduced query accuracy, and performance and efficiency issues are prominent when processing large amounts of address data.

Method used

Adopting a regular expression-based invalid address and term filtering mechanism, combined with dynamic vocabulary updates and Elasticsearch query optimization, the accuracy and efficiency of address queries are improved through verification, invalid address exclusion, word segmentation processing and weight setting.

Benefits of technology

The system's ability to handle complex and non-standard address formats has been significantly improved, the flexibility in handling newly emerging addresses has been enhanced, invalid addresses and entries have been effectively identified and excluded, and query logic and performance have been optimized, especially in real-time query scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723804A_ABST
    Figure CN120723804A_ABST
Patent Text Reader

Abstract

The invention discloses an accurate self-matching method and system based on address search, and relates to the technical field of computers, and the method comprises the steps: carrying out verification according to a preset standard for a received external address query request; after invalid address elimination and invalid word filtering are carried out on the address query request passing verification, an Elasticsearch query statement is established, query is executed, and a result is obtained; and after unnecessary or redundant data in the query result is removed, returning the data to the requester. According to the method, the query accuracy is remarkably improved, and meanwhile resource waste caused by invalid query is reduced. In the aspect of address processing, exclusion of invalid addresses and invalid words is particularly concerned, an automatic recognition and exclusion method based on a regular expression is adopted, and the problem of invalid addresses is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an address-based search and accurate self-matching method and system. Background Art

[0002] In the field of address query and geolocation prediction, there is a complex technical background, which mainly involves two key systems: one is the cloud system that provides site selection and prediction services for all contact points in the province (such as PCs and mobile applications), and the other is the customer service system that is currently directly connected to the local network interface. The cloud system plans to completely take over the functions of the customer service system in the future. The core functions of these systems include first calling the local network interface to provide site selection and prediction services based on the needs of a specific area. Only when the local network interface cannot provide qualified results will the system turn to latitude and longitude-based predictions as a backup.

[0003] In the existing technology, it is usually necessary to rely on an integrated geographic information system (GIS) and an address database to provide accurate geographic location services. These systems can process the address information provided by the user and return the geographic location information through database query or geocoding technology. The operator in the customer service system will directly enter the address information provided by the user into the system for query. If the query results returned by the system do not meet the expectations, the operator will turn to more advanced technologies, such as latitude and longitude-based predictions, to obtain more accurate location information. These systems may use various algorithms and methods to optimize the address resolution process, including using regular expressions to filter invalid addresses, custom word segmentation technology to improve the accuracy of address resolution, and using dynamic word library update mechanisms to cope with changes in address data.

[0004] However, existing technologies have some shortcomings in address cleaning and query optimization:

[0005] 1. Inadequate handling of complex address formats: Existing systems may have difficulty accurately handling various complex and non-standardized address formats, especially in areas with unique geographical and administrative characteristics.

[0006] 2. Static vocabulary limitations: Many address query systems use static vocabulary, which limits the system's flexibility and accuracy in handling new or rare addresses.

[0007] 3. Insufficient processing of invalid addresses and entries: Existing technologies may not be sufficient to effectively identify and filter invalid addresses and entries, resulting in reduced query accuracy.

[0008] 4. Performance and efficiency issues: Existing technologies may face performance and efficiency issues when processing large amounts of address data, especially in real-time query scenarios. Summary of the Invention

[0009] In order to solve the above problems, the purpose of the present invention is to provide an accurate self-matching technology based on address search, aiming to improve the accuracy and efficiency of the address query system.

[0010] To achieve the above technical objectives, the present application provides a method for accurate self-matching based on address search, comprising the following steps:

[0011] Verify received external address query requests based on preset standards;

[0012] For address query requests that have passed verification, after invalid addresses are excluded and invalid words are filtered, an Elasticsearch query statement is established, the query is executed, and the results are obtained;

[0013] After removing unnecessary or redundant data from the query results, the data is returned to the requester.

[0014] Preferably, in the process of invalid address exclusion, before address query, invalid entry data is set to empty and invalid words are filtered. At the same time, invalid words are controlled through the database table and synchronized to Redis at regular intervals, where invalid words represent words that appear in address keywords but do not participate in actual address matching.

[0015] Preferably, when performing invalid address exclusion, a regular expression is used to filter invalid words at the end of the address.

[0016] Preferably, when filtering invalid words at the end of an address, the invalid words at the end of the address are filtered by removing invalid words that end with a number, removing the 9th to 11th level keywords at the end of the address, and intercepting the first number contained therein.

[0017] Preferably, when constructing an Elasticsearch query statement, the matching rate is dynamically calculated based on the number of tokens after word segmentation to set the Elasticsearch query statement.

[0018] Preferably, when constructing an Elasticsearch query statement, the query result is optimized by setting different weights for addresses of different levels to set the Elasticsearch query statement, wherein invalid common words in the address are excluded by using a regular expression.

[0019] Preferably, when constructing an Elasticsearch query statement, an internal dynamic loading method is used to periodically pull the latest entries from a specified data source through a scheduled task to automatically update the vocabulary.

[0020] Preferably, when updating the vocabulary, each time after the vocabulary is updated, each piece of data is reprocessed, new word segmentation rules are applied, and its representation in the inverted index is updated.

[0021] Preferably, before returning data to the requester, the response content in JSON format is parsed according to the query results, the results are sorted according to specific business rules or user preferences, the sorted results are filtered, and non-essential or redundant data are formatted to form a structured response body, and the data is returned to the requester, wherein the response body includes the returned data itself, a status indication of success or failure, possible error messages, warnings, and paging information.

[0022] The present invention discloses a precise self-matching system based on address search, which is used to implement the aforementioned precise self-matching method based on address search, including:

[0023] A verification module, configured to verify a received external address query request according to a preset standard;

[0024] The query module is used to exclude invalid addresses and filter invalid words for verified address query requests, then build an Elasticsearch query statement, execute the query, and obtain the results;

[0025] The return module is used to remove unnecessary or redundant data from the query results and return the data to the requester.

[0026] The present invention discloses the following technical effects:

[0027] The present invention improves the system's ability to process complex and non-standard address formats through advanced word segmentation technology and dynamic word library.

[0028] The present invention implements a hot-loading vocabulary mechanism, which enables the system to dynamically update the vocabulary based on real-time data, thereby improving the accuracy of processing newly appeared or rare addresses.

[0029] The present invention effectively identifies and excludes invalid addresses and entries by using regular expressions and other advanced technologies, thereby improving the accuracy of query results.

[0030] The present invention optimizes query logic and processing flow, improving the performance and efficiency of the system when processing large amounts of data, especially in real-time query scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0032] Figure 1 It is a schematic flow chart of the method described in the present invention;

[0033] Figure 2 is a schematic diagram of the interaction between invalid words and a database according to the present invention;

[0034] Figure 3 is a schematic diagram of re-indexing execution according to the present invention;

[0035] Figure 4 It is a schematic diagram of the principle of the parabola formula of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0037] like Figure 1-3 As shown, the present invention provides a precise self-matching technology based on address search, including: request reception and verification, address data preprocessing, precise word segmentation, and intelligent exclusion of invalid addresses and entries. Specifically for address processing, the present invention utilizes advanced regular expressions and custom filtering mechanisms, which effectively reduce invalid data interference and ensure that search keywords accurately refer to specific geographic markers. Furthermore, by updating the ES index in real time and performing regular maintenance tasks, the system not only maintains data freshness and consistency, but also improves overall query performance and system response efficiency.

[0038] According to the actual production needs of the enterprise, the present invention is divided into the following Figure 1 The process shown.

[0039] 1. Request reception and verification:

[0040] After the system boots up, it enters a standby state, waiting to receive external address query requests. Each time a request is received, the system first performs a series of validation steps to ensure the validity and correctness of the request. These validation steps include checking that the request is formatted correctly and verifying that the parameters included in the request are valid and reasonable.

[0041] This stage is the key entry point for the entire query process, ensuring that only requests that meet the preset criteria are processed further.

[0042] 2. Address processing:

[0043] After receiving and verifying the request, the system will carefully process the input address data. This process is mainly divided into two key steps: invalid address exclusion and invalid word filtering.

[0044] 2.1 Invalid address exclusion:

[0045] In this invention, we specifically focus on eliminating invalid addresses. These are addresses that don't clearly refer to a specific geographic location, such as those containing only broad administrative division names or consisting entirely of numbers. These addresses are useless in real-world queries because they're either too general to refer to a specific location or don't conform to conventional address formats.

[0046] To effectively address this problem, the present invention employs an automatic identification and exclusion method based on regular expressions. This method involves defining a series of regular expression rules specifically for matching possible invalid address patterns. When an address query request is submitted to the system, these rules are used to perform a preliminary screening of the input address. If the input address matches any of the defined invalid address patterns, the system will automatically identify it as invalid and prevent it from further processing. In addition, the system will provide clear feedback to the user, prompting them to provide more specific and accurate address information. This method significantly improves the accuracy and efficiency of the address query system and reduces the waste of resources caused by invalid queries.

[0047] 2.2 Custom invalid word filtering (cutting off the first word):

[0048] In the present invention, optimization of the address query system also includes processing "invalid words." Invalid words are words that appear in address keywords but are not used in actual address matching. These words are generally considered invalid data. For example, in map-based site selection and prediction, users may only be able to provide general area information due to lack of knowledge of specific street names. In this case, the presence of invalid words can interfere with the accuracy of address queries.

[0049] To solve this problem, the present invention proposes a mechanism that reduces interference by emptying the invalid entry data before address query, enabling the searched address keywords to more clearly refer to specific geographical markers. For example, the address "Unit 1, 6th Floor, No. 610, Block 2, Plot 5, Greenland Future City, Taihua Road, Zhangcha Street, Chancheng District, Foshan City, Guangdong Province" will become the more precise "No. 610, 6th Floor, Unit 1, Block 2, Plot 5, Greenland Future City, Taihua Road" after removing the invalid words.

[0050] As Figure 2 shown, to achieve this goal, the data management of invalid words is controlled through database tables and synchronized to Redis at regular intervals. This allows the program to load data from Redis in real time for effective matching and replacement of address keywords. At the same time, the system also provides a manual method to synchronize invalid words from the MySQL database to Redis to ensure timely data update and accuracy.

[0051] In addition, the way invalid words interact with the database significantly improves the performance of the address prediction and query system, especially when dealing with address information containing a large number of non-keyword vocabulary, the effect is particularly significant.

[0052] 2.3 Regular invalid word filtering (removing the tail):

[0053] During the optimization of the address query system, one of the key challenges is to process and optimize address data containing invalid vocabulary, especially those invalid words at the end of the address. Such invalid words, such as overly long numerical sequences or specific building unit identifiers, may lead to inaccurate or irrelevant query results.

[0054] To solve this problem, the present invention proposes a method for filtering invalid words at the end of the address using regular expressions. This method is executed before calling the ES (Elasticsearch) API to remove invalid word elements in the address keywords that may interfere with query accuracy. Implementing this method includes the following key steps:

[0055] Step 1: Remove invalid words ending with numbers: Use the regular expression [a-zA-Z0-9一二三四五六七八九十百千甲乙丙丁\\-]+$ to identify and delete such invalid words.

[0056] Step 2: Remove 9th to 11th level keywords at the end of the address: Filter through the regular expression ([a-zA-Z0-9一二三四五六七八九十百千甲乙丙丁东南西北后前\\-]+(号楼|单元|栋|幢|座|区|舍|梯|期|门|排|号门|楼层|层|楼|房间号|房间|房|户|室)+)+$.

[0057] Step 3: Extract the first number included in Step 2: Use the regular expression ^[a-zA-Z0-9一二三四五六七八九十百千甲乙丙丁东南西北后前\\-] to complete this operation.

[0058] For example, after the above filtering, the address "Phase 1, Building 9, Unit 203, Evergrande Yuefu" will be transformed into a more precise "Evergrande Yuefu Phase 1". The application of this method significantly improves the accuracy and relevance of address queries, which is particularly important for systems that require precise geographical location information, effectively avoiding query errors caused by address format problems.

[0059] 3. Query construction and execution:

[0060] Construct an Elasticsearch query statement based on the preprocessing and tokenization results. Execute the query in Elasticsearch and obtain the results.

[0061] 3.1 Dynamically calculate the text matching rate:

[0062] In an address query system, the calculation of the text matching rate is a key link to improve the accuracy of Elasticsearch queries. The text matching rate is a parameter set through the `minimum_should_match` attribute in the ES query, which is used to control the matching degree between the tokenized tokens and the address text. The value range of this attribute is from 0% to 100%, which determines how many words or terms must be matched at least in the `should` clause of the boolean query.

[0063] In traditional methods, `minimum_should_match` is often set to a fixed value. For example, it may be 70% for the name field and 40% for the detailedaddr field. However, there is a problem with this fixed value setting: as the length of the address keyword increases, the probability of correctly matching the address may decrease.

[0064] Figure 4 As shown, for this reason, this technology proposes a method to dynamically calculate the matching rate according to the number of tokens after tokenization. This method uses the parabolic formula `-ax^2 + c` to calculate the text matching rate.

[0065] Among them, `a` is the quadratic coefficient, which determines the opening direction and steepness of the curve, and its value range is from -9 to 9. `x` is a variable representing the number of tokens after tokenization, which can be obtained by calling the ` / _analyze` endpoint of the ESAPI. `c` is the constant term, representing the y-axis intercept of the quadratic equation, which determines the intersection position of the curve and the y-axis, and its value range is from 20% to 80%.

[0066] Definition of quadratic function: Generally speaking, if the relationship between two variables x and y can be expressed as (a, b, c are constants, a≠0), then y is called a quadratic function of x; y = ax^2 + bx + c

[0067] When b=0, c≠0: y=ax^2+c The graph forms a parabola shape 1. When a>0, the graph (parabola) opens upward. The larger a is, the smaller the opening of the parabola is. 2. When a<0, the graph (parabola) opens downward. The smaller a is, the smaller the opening of the parabola is.

[0068] The values ​​of a from -9 to 0 and from 0 to 9 form two parabolas respectively. Two curves with different steepness appear in the overlapping part of the parabolas, which are represented as the matching rate curve.

[0069] This dynamic calculation method can more effectively adapt to address queries of varying length and complexity, significantly improving the accuracy and relevance of query results. This parabolic formula-based approach enables the system to flexibly adjust matching criteria based on the actual address text length and complexity, effectively responding to a variety of query scenarios.

[0070] 3.2. Query weight setting:

[0071] The key to implementing effective address lookups in Elasticsearch is properly setting query weights. This ensures the accuracy and relevance of query results and is the core of the weighting strategy for efficient address lookups. This process requires a deep understanding of Elasticsearch's scoring mechanism, particularly the application of term weights, term frequency (TF), and inverse document frequency (IDF). Term weights serve as the foundational query weights and can be customized based on requirements. TF reflects the frequency of a term's occurrence in the search text; higher frequencies indicate greater relevance to the search context. IDF, on the other hand, measures the prevalence of a term across the entire index; higher frequencies indicate lower relevance to a specific search.

[0072] In order to improve the accuracy of the query in practical applications, the present invention adopts a weight (boost value) setting method based on the address level, rather than directly modifying the TF and IDF parameters. Specifically, the query results are optimized by setting different weights for addresses of different levels. For example, a level 7 address may be set to a boost value of 1.5, while a level 8 address is set to 1.3. In this way, when the word segmentation result of the address keyword matches an address of a higher level, the address will obtain a higher weight and thus obtain a higher ranking in the query results. For example, when processing the address "610, Unit 1, Building 2, Block 5, Greenland Future City, Taihua Road, Zhangcha Street, Chancheng District, Foshan, Guangdong Province", if the word segmentation result contains a word that matches the name of a level 7 address (such as "Greenland Future City Block 5"), the score of this address will be 1.5 times the basic score.

[0073] Furthermore, to further improve query accuracy, the present invention employs regular expressions to exclude invalid, common terms that could negatively impact the final score. For example, common, but invalid, terms like "street," "apartment," and "building" are excluded. This approach ensures that the address query system can more accurately identify and return the most relevant address information when processing complex queries, thereby improving user experience and system efficiency.

[0074] 3.3、Optimize Chinese address processing and dynamic IK word segmentation strategy in Elasticsearch environment:

[0075] One of the main challenges in processing Chinese address data in an Elasticsearch environment is that the built-in word segmentation plugin for Elasticsearch is primarily designed for English and is not ideal for Chinese, particularly location names. To improve this, we selected the IK word segmentation plugin, a word segmentation tool optimized specifically for Chinese. While the IK plugin provides basic Chinese word segmentation capabilities, its default static vocabulary primarily covers common vocabulary and is not ideal for terminology specific to specialized fields or regions, such as specific neighborhood or street names.

[0076] In order to solve this problem, the present invention proposes a dynamic vocabulary loading solution based on business data to improve the pertinence and accuracy of word segmentation. This solution allows the word segmentation vocabulary to be customized and updated according to actual business needs, making it more suitable for address data processing in specific projects. There are two ways to implement this solution: the first is to load hot words in the IK plug-in by configuring the URL path; the second is to implement the function of regularly pulling hot words within the IK plug-in code. Although the first method is easy to operate, it has limitations such as fixed update frequency, excessive reliance on external interfaces, and possible performance problems under large data volumes. Therefore, the second method is adopted to implement dynamic loading and updating of hot words within the plug-in. This not only provides greater flexibility and control, but also reduces the risk of loading failure due to network problems.

[0077] By adopting the internal dynamic loading method, the system automatically updates the vocabulary by regularly pulling the latest entries from the designated data source through scheduled tasks. This allows for real-time adjustments to the word segmentation strategy based on project progress and data changes, ensuring that address data processing remains synchronized with business needs. This dynamic and adaptive word segmentation management approach significantly improves the accuracy and efficiency of the address query system when processing geographic data, especially when processing Chinese addresses in specific regions or specialized fields.

[0078] 4. Result analysis and response:

[0079] Result analysis and response is a key step from receiving a query request to returning the final result. During this process, the data is carefully processed. First, the process begins by extracting the query results returned by Elasticsearch. This includes parsing the JSON-formatted response content, such as extracting the hit document set, score, and any relevant aggregated data.

[0080] Once this data has been extracted, the next step is to sort the results based on specific business rules or user preferences. This sorting process may take into account various parameters such as relevance scores, specific fields of the document, or timestamps.

[0081] The system then filters these results to remove unnecessary or redundant data. This step ensures that only the information most relevant to the user is presented in the response. This critical information is then formatted into an appropriate structure, such as a list, mapping table, or custom data structure, to suit the requester's data processing needs.

[0082] After the data formatting phase, the system further analyzes and verifies the retrieved documents for relevance. If necessary, search parameters are adjusted to improve the accuracy of the results, and the search strategy is continuously optimized based on feedback. Finally, the system constructs a structured response body and returns the data to the requester. This response body includes not only the returned data itself, but also a status indication of success or failure, possible error messages, warnings, and paging information. This process ensures that the query system can respond to user queries in the most effective manner, improving user experience and system efficiency.

[0083] 5. Logging and Monitoring:

[0084] In address query systems, logging and performance monitoring are two key components for ensuring system stability and optimizing performance. The primary purpose of logging is to maintain a detailed history of system operations, including user query requests, system responses, error or exception information, and other important system events. These records are crucial for identifying system operational trends, potential errors, and performance bottlenecks. For example, log analysis can reveal which types of queries are most frequent or which queries may result in abnormal responses, thereby guiding system optimization efforts.

[0085] Performance monitoring focuses on real-time tracking and evaluation of system health, including metrics such as CPU utilization, memory usage, disk I / O, and network traffic. Monitoring the health of the Elasticsearch cluster is particularly critical, as it directly impacts query performance and data reliability. Performance monitoring data not only helps promptly identify and resolve system overloads and resource bottlenecks, but also serves as a valuable reference for evaluating the effectiveness of system upgrades or optimization measures.

[0086] Combining logging and performance monitoring provides strong support for maintaining an efficient, stable, and reliable address query system. Through in-depth log analysis and continuous monitoring of performance data, we can proactively identify and resolve issues, optimize system configuration, and ensure fast and accurate query services, significantly improving the user experience. This comprehensive approach not only helps maintain long-term system stability but also provides data support and insights for potential future system upgrades and improvements.

[0087] 6. Index update and maintenance:

[0088] like Figure 3 As shown in the figure, in address search and indexing systems based on Elasticsearch (ES), re-indexing is particularly important, especially when the vocabulary is updated or modified. Taking the term "Taihe Red County Mansion" as an example, we can illustrate the necessity of re-indexing.

[0089] In the original situation, before the term "Taihe Red County Mansion" was added to the thesaurus, its word segmentation results might be "Tai", "He", "Hong", "Jun", "Fu". This word segmentation method affected the processing logic of ES when constructing the inverted index, that is, treating each individual token as an independent index term. The inverted index is the key to efficient search in ES, enabling the system to quickly locate all documents containing a specific token.

[0090] However, when "Taihe Red County Mansion" was added to the hot word library, its word segmentation processing changed significantly and it was recognized as a complete vocabulary "Taihe Red County Mansion". This change means that during search, ES will treat it as a whole instead of multiple independent tokens as before. Therefore, if the existing data in the system is indexed based on the old word segmentation method, then when searching for "Taihe Red County Mansion", these data cannot be matched because their indexes are established according to the old word segmentation rules.

[0091] To ensure the accuracy of search and data consistency, whenever the thesaurus is updated, it is necessary to re-index the existing data. The process of re-indexing includes reprocessing each piece of data, applying the new word segmentation rules, and updating its representation in the inverted index. This process ensures that regardless of whether the data was added before or after the thesaurus update, it can be accurately matched and retrieved during search. In this way, re-indexing becomes a crucial step in ensuring accurate search results and data consistency, especially when the thesaurus is updated.

[0092] This invention has obvious advantages compared with the prior art in improving the accuracy and efficiency of the address query system. By using advanced regular expressions and a custom filtering mechanism, it effectively reduces the interference of invalid data and ensures that the search keywords can accurately refer to specific geographical markers. This method significantly improves the accuracy of the query and reduces the waste of resources caused by invalid queries. In terms of address processing, this invention particularly focuses on the exclusion of invalid addresses and invalid words, and adopts an automatic recognition and exclusion method based on regular expressions, effectively solving the problem of invalid addresses.

[0093] In addition, this invention also involves the processing of "invalid words". By setting these terms to be empty before the query, interference is reduced, enabling the search address keywords to more clearly refer to specific geographical markers. Through this method, the address query system not only maintains the currency and consistency of the data, but also improves the overall query performance and system response efficiency, which is particularly suitable for the actual production needs of enterprises.

[0094] The term explanations for the above content are as follows:

[0095] Redis: An open-source, network-friendly, in-memory, and persistent log-based key-value database written in ANSI C. It offers APIs in multiple languages. It supports a relatively wide range of value types, including strings, lists, sets, sorted sets (zsets), and hashes. To ensure efficiency, Redis caches data in memory, making it a high-performance key-value database.

[0096] A regular expression is a text pattern that includes common characters (for example, letters from a to z) and special characters (called metacharacters). It is a concept in computer science. A regular expression uses a single string to describe and match a series of strings that match a certain syntactic rule. It is often used to search for and replace text that meets a certain pattern (rule).

[0097] ES: (Elasticsearch) is an open source full-text search engine based on the Lucene library. Elasticsearch is developed in Java and released as a RESTful web service. It provides a distributed, multi-tenant full-text search engine with an HTTP network interface and schema-free JSON documents. Elasticsearch is built on Lucene, and its main features include: distributed, scalable, real-time full-text search and analysis engine. It can quickly store, search, and analyze large amounts of data. It is often used to build complex search capabilities such as real-time indexing, geolocation analysis, and aggregation, and can handle complex queries in a variety of different formats.

[0098] IK Word Segmenter: This is a Chinese word segmentation tool primarily used to break down Chinese text into individual keywords. When searching, we often segment our own information, or data in a database or index, and then perform a matching operation. It provides two word segmentation modes: Fine-Grained and Smart. This is a powerful, efficient, and accurate Chinese word segmentation plugin suitable for a variety of Chinese search and text processing scenarios.

[0099] Term frequency: Term frequency refers to the number of times a word appears in a document. It is commonly used in text mining and information retrieval to assess the importance of a word in a document. A higher term frequency indicates a greater importance of the word in the document. In Elasticsearch (ES), the TF-IDF algorithm also uses term frequency as a factor in calculating document relevance.

[0100] TF-IDF: (Term Frequency-Inverse Document Frequency) is a commonly used weighting technique for information retrieval and text mining. It evaluates the importance of a term to a document by calculating the term frequency (TF) of a term in a document and the inverse document frequency (IDF) in the entire corpus. In Elasticsearch (ES), TF-IDF is a key factor used for scoring. ES uses the TF-IDF algorithm to calculate the relevance score between the query and the document in order to rank the documents in the search results. When a user executes a query in ES, ES automatically calculates the TF-IDF score of each document and the query, and returns the documents most relevant to the query. Although TF-IDF is one of the default scoring algorithms in ES, ES also supports other scoring algorithms and custom scoring functions to meet different scenarios and needs.

[0101] An API (Application Programming Interface) is a specification or standard that defines how to interact with a specific software application. An API allows developers to communicate with an application using a specific programming language (such as Java, Python, or JavaScript) to perform specific tasks or access specific functionality. This makes it easy for developers to use third-party software components or services, while increasing the reusability and scalability of applications.

[0102] Weight: When searching for addresses in Elasticsearch and increasing query weight, you can use address levels and set level attributes to double the query weight, thereby achieving accurate prediction.

[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0104] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0105] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for accurate self-matching based on address search, characterized in that: The following steps are involved: Verify received external address query requests based on preset standards; For address query requests that have passed verification, after invalid addresses are excluded and invalid words are filtered, an Elasticsearch query statement is established, the query is executed, and the results are obtained; After removing unnecessary or redundant data from the query results, the data is returned to the requester.

2. The method for accurate self-matching based on address search according to claim 1, characterized in that: In the process of invalid address exclusion, before address query, invalid entry data is set to empty and invalid words are filtered. At the same time, the invalid words are controlled through the database table and synchronized to Redis at regular intervals. Invalid words refer to words that appear in address keywords but do not participate in actual address matching.

3. The method for accurate self-matching based on address search according to claim 2, characterized in that: When performing invalid address exclusion, use regular expressions to filter invalid words at the end of the address.

4. The method for accurate self-matching based on address search according to claim 3, characterized in that: When filtering invalid words at the end of an address, invalid words ending with numbers are removed, 9th to 11th level keywords at the end of the address are removed, and the first number contained therein is intercepted to filter invalid words at the end of the address.

5. The method for accurate self-matching based on address search according to claim 1, characterized in that: When constructing an Elasticsearch query statement, the matching rate is dynamically calculated based on the number of tokens after segmentation to set the Elasticsearch query statement.

6. The method for accurate self-matching based on address search according to claim 1, characterized in that: When constructing an Elasticsearch query statement, the query results are optimized by setting different weights for addresses at different levels. In this way, the Elasticsearch query statement is set up, wherein invalid common words in the address are excluded by using regular expressions.

7. The method for accurate self-matching based on address search according to claim 1, characterized in that: When constructing Elasticsearch query statements, an internal dynamic loading method is used to regularly pull the latest entries from the specified data source through scheduled tasks and automatically update the vocabulary.

8. The method for accurate self-matching based on address search according to claim 7, characterized in that: When updating the vocabulary, each time the vocabulary is updated, each piece of data is reprocessed, new word segmentation rules are applied, and its representation in the inverted index is updated.

9. The method for accurate self-matching based on address search according to claim 8, characterized in that: Before returning data to the requester, the response content in JSON format is parsed based on the query results, the results are sorted according to specific business rules or user preferences, the sorted results are filtered, and non-essential or redundant data is formatted to form a structured response body, which is then returned to the requester. The response body includes the returned data itself, a status indication of success or failure, possible error messages, warnings, and paging information.

10. A precise self-matching system based on address search, used to implement the precise self-matching method based on address search according to claims 1-9, characterized in that: include: A verification module, configured to verify a received external address query request according to a preset standard; The query module is used to exclude invalid addresses and filter invalid words for verified address query requests, then build an Elasticsearch query statement, execute the query, and obtain the results; The return module is used to remove unnecessary or redundant data from the query results and return the data to the requester.

Citation Information

Patent Citations

  • Method and device for establishing incremental code library

    CN103514235A

  • Address matching method and device, computer equipment and storage medium

    CN110442603A

  • Unified search lexicon updating method and device

    CN113190569A

  • Chinese address matching method based on address element index

    CN114168705A