Fuzzy address matching method based on parallel processing in electric power scene
Through the parallel processing framework and the Levenshtein distance algorithm combined with regular expressions, the problem of non-standardized data processing and large-scale data in the power system is solved, efficient and accurate address matching is achieved, and the reliability and speed of power business processes are improved.
Patent Information
- Application Number
- CN202510442386.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-08
AI Technical Summary
Traditional address matching methods cannot effectively process non-standardized data in power systems, resulting in misjudgment and misjudgment. The large-scale data processing efficiency is low. The fuzzy matching algorithm is not flexible enough when facing diversified and dynamically changing address data and cannot meet the needs of high-precision matching.
The parallel processing framework is used to combine the Levenshtein distance algorithm and regular expressions, and through data preprocessing, address grouping and region division, parallel calculation, fuzzy matching and missing-checking methods, it can effectively identify address information with slightly different expressions but substantially the same.
It significantly improves the processing efficiency of large-scale data sets, improves the accuracy and reliability of address matching, ensures the accuracy and efficiency of subsequent business processes, optimizes resource allocation, and supports more accurate energy management and scheduling decisions.
Smart Images

Figure CN120448596A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence algorithms, and in particular to a fuzzy address matching method based on parallel processing in an electric power scenario. Background Art
[0002] In modern power management and operations, ensuring the compliance and accuracy of data forms used is crucial for any business operation. However, in practice, widespread data inconsistencies pose a significant challenge to the efficient operation of the power industry. For example, when calculating PV capacity, intranet addresses may not match marketing addresses. In this case, performing the calculation without resolving the address mismatch can lead to significant data discrepancies and inaccurate results. Specifically, due to the inconsistency between marketing and intranet addresses, PV capacity calculations may be based on incorrect grid connection point information, resulting in misleading output. This not only seriously impacts calculation accuracy but can also lead to improper resource allocation and service planning errors. Therefore, address matching is required before executing any business operations. This ensures that each marketing address is matched to its corresponding intranet address. This ensures that all subsequent calculations and decisions are based on accurate and compliant data, thereby improving the reliability and efficiency of overall business processes. Furthermore, effective address matching helps optimize resource allocation, mitigates potential operational risks, and supports more accurate energy management and scheduling decisions.
[0003] Traditional address matching methods often rely on simple string comparisons or exact equality checks, which exhibit significant shortcomings when handling complex business requirements. Due to the diversity and non-standardized input of address data, direct equality comparisons cannot effectively identify addresses that are similar but not identical, resulting in a large number of false positives and missed matches. Furthermore, when the data volume involved is large, traditional iterative matching methods are extremely inefficient and time-consuming. For two tables containing large numbers of records, each record must be compared with all records in the other table, resulting in exponentially increasing computational complexity, consuming significant computing resources, and severely impacting processing speed and real-time responsiveness. Full comparisons between large datasets not only require powerful hardware support but also take a long time to process, making this unacceptable for the power industry, which demands rapid decision-making and efficient operations. Especially in business scenarios with high real-time requirements, this inefficient processing method directly impacts the smooth flow of business processes, and in turn, affects overall service quality and user experience. Although fuzzy matching algorithms are designed to address issues caused by address format differences, in practice, even if two addresses essentially match, the presence of specific characters, abbreviations, spaces, or other subtle differences can cause the algorithm to assign a lower match score, ultimately leading to the incorrect exclusion of addresses that should have been correctly matched. This phenomenon not only reduces the success rate of address matching but also affects the accuracy of subsequent business processes. Fuzzy matching algorithms typically evaluate the similarity between addresses based on specific rules or models. However, when faced with diverse and dynamically changing address data, their evaluation criteria can be inflexible and prone to deviations. In particular, when addresses contain missing information or are vaguely expressed, the effectiveness of fuzzy matching is significantly reduced, failing to meet the requirements for high-precision matching.
[0004] Traditional address matching methods face significant problems and challenges when dealing with complex business requirements in power systems, specifically in the following aspects:
[0005] 1. Difficulty in Processing Non-Standardized Data: In the operational environment of power systems, address information often comes from multiple different sources, potentially containing various formats, encoding methods, and differences in entry conventions. Traditional matching methods struggle to effectively handle this non-standardized data input and are unable to flexibly adapt to subtle variations in address information, such as extra characters, abbreviations, or spelling differences. This results in a large number of similar, but not identical, addresses being mistakenly identified as mismatched, impacting the accuracy and reliability of subsequent business operations.
[0006] 2. Efficiency bottlenecks in large-scale data processing: When faced with massive data sets, traditional iterative matching methods become extremely inefficient due to the exponentially increasing computational complexity. Each record must be compared with all other records, requiring powerful hardware and resulting in significant processing delays. Real-time decision-making and efficient operations are crucial in the power industry, so this approach cannot meet the demands of rapid response, impacting smooth business processes and service quality.
[0007] 3. Limitations of fuzzy matching algorithms: Although fuzzy matching algorithms are designed to improve the flexibility and accuracy of address matching, they still have many limitations in practical applications. Fuzzy matching relies on preset rules or models to evaluate the similarity between addresses. When faced with diverse and dynamically changing address data, its evaluation criteria may not be flexible enough and prone to deviations. In particular, when address information is partially missing or vaguely expressed, the effectiveness of fuzzy matching is greatly reduced, and high-precision matching cannot be guaranteed. In addition, fuzzy matching may underestimate the similarity between some addresses that actually match, resulting in the incorrect exclusion of addresses that should have been correctly identified, affecting the accuracy of subsequent business processes. Summary of the Invention
[0008] In view of this, the present invention provides a fuzzy address matching method for parallel processing in an electric power scenario to solve the above technical problems.
[0009] A fuzzy address matching method for parallel processing in an electric power scenario includes the following steps:
[0010] Step 1: Data preprocessing: Preprocess the marketing addresses and intranet addresses in the distributed photovoltaic grid-connected information, including removing null values and outliers that are obviously not addresses;
[0011] Step 2: Address grouping and regional division: Classify intranet addresses by geographical region to obtain address groups to narrow the matching range;
[0012] Step 3: Introduce a parallel computing framework to decompose the task of matching the network address with the marketing address: By introducing a parallel computing framework, and then using distributed computing resources, the matching task is decomposed into multiple nodes for simultaneous execution;
[0013] Step 4: Matching calculation: Use the Levenshtein distance algorithm to calculate the similarity between the strings and obtain the similarity score between the intranet address and the marketing address.
[0014] Step 5: Filter high-match results: Based on the calculated similarity score and the preset high-score threshold, filter out high-score matches as preliminary results;
[0015] Step 6: Check for missing addresses with low matching scores: For addresses with low matching scores but potentially related, we develop specific rules and combine them with regular expressions to check for missing addresses and identify substantially identical address records.
[0016] Step 7: Final result output: Combine the results obtained in steps 5 and 6 and output them.
[0017] Furthermore, step 1 of data preprocessing specifically includes: first, identifying and removing all records that are missing a certain address segment; at the same time, screening and excluding data points that are not in a valid address format.
[0018] Furthermore, the data points that are not in a valid address format include pure numeric sequences, random character combinations, or character strings that are too short or too long.
[0019] Furthermore, step 2 of address grouping and regional division specifically includes: constructing a list containing the names of all districts and counties in a province, and in each iteration process, only selecting addresses that meet the conditions of the current processing district and county for comparison.
[0020] Furthermore, step 3 introduces a parallel computing framework to decompose the matching task, specifically including:
[0021] Step 3.1. Import the multiprocessing and functools.partial modules to support parallel processing and partial function application. Use the multiprocessing module to create a process pool object, pool, and control the number of concurrently running processes by specifying parameters.
[0022] Step 3.2: Define a matching function called match. One of the matching addresses is the address record to be matched, i.e., the marketing address, and the other is a fixed address list, i.e., the intranet address. The matching function matches executes the specific matching logic and returns the matching result.
[0023] Step 3.3: Use the pool.map() function to automatically distribute the task of matching each marketing address with the intranet address list to idle worker processes.
[0024] Furthermore, step 3.2 specifically includes:
[0025] Use functools.partial to create a new function instance and pre-bind the second parameter of the match function to facilitate passing different marketing addresses to the match function. Then, all the marketing addresses of a certain district or county are integrated into a list. Each element in the list is passed as the first parameter of the match function. This step clarifies which addresses will participate in the matching calculation of the current batch. At the same time, a fixed list is constructed, which is the second parameter of the match function. This second parameter contains the intranet addresses of the corresponding district or county.
[0026] Furthermore, step 3.3 specifically includes:
[0027] The pool.map() function creates a matching task for each marketing address in the list and submits these tasks to the worker processes in the process pool in parallel. Each worker process receives a marketing address and the entire intranet address list as input parameters, then executes the matching logic and returns the best matching score. Once all tasks are completed, the pool.map() function automatically summarizes all results to form a complete output list containing the best matches for all marketing addresses in the district or county. Finally, the pool.close() method is called to close the process pool and no longer accept new tasks. The pool.join() method is then called to block the main process until all worker processes in the process pool complete their tasks and terminate.
[0028] Furthermore, step 4, matching degree calculation, specifically includes:
[0029] After building the parallel computing framework, we implemented fuzzy matching using the process module in fuzzywuzzy and used the process.extractOne() function to select the single best match. The process.extractOne() function accepts two main parameters: the first is the target string to be matched, i.e., the marketing address, and the second is a list of candidate strings containing intranet addresses.
[0030] By calculating the similarity score between the marketing address and each intranet address in the list, a tuple is returned. The tuple contains the most similar strings and the similarity score between them. The similarity score indicates the degree of match between the target string and the closest candidate string. A higher score indicates a closer match.
[0031] Furthermore, the similarity score is calculated based on the Levenshtein distance, also known as the edit distance, which is used to measure the difference between two strings, specifically referring to the minimum number of single-character editing operations required to convert one string into another, where the editing operation includes inserting, deleting, or replacing a character.
[0032] Furthermore, the low matching result in step 6 is checked for omissions and filled in the gaps, specifically including: truncating the character string by using a regular expression, retaining only some characters, and then comparing again.
[0033] The present invention has the following characteristics:
[0034] 1. This invention uses a multiprocessing framework to implement multi-process parallel processing, fully leveraging the advantages of multi-core processors to significantly improve the efficiency of processing large-scale data sets. Through process pool management and task queue mechanisms, this invention can efficiently allocate and process parallel tasks, reduce the time complexity of data processing, and enhance the system's processing capabilities.
[0035] 2. The present invention uses the fuzzywuzzy framework and Levenshtein distance algorithm to perform string fuzzy matching, effectively identifying address information that is slightly different in expression but essentially the same.
[0036] 3. The present invention introduces a rule system based on regular expressions to handle low-matching results and make up for possible omissions in fuzzy matching. This method focuses on more specific geographic location descriptions, ignores non-critical address components, enhances the system's ability to handle non-standardized inputs, and improves the accuracy and reliability of matching. Through predefined rules, the present invention ensures the high accuracy and compliance of matching results, and improves the efficiency and reliability of the overall business process. In actual business, there are about 100,000 pieces of data that have been filed but not connected to the grid. By using a fuzzy matching algorithm, more than 10,000 valid intranet addresses are matched for users who have been filed but not connected to the grid, while using strict exact matching can only get about 1,000 valid intranet addresses, which is an improvement of 90%. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a schematic diagram of an embodiment of the present invention using rules to filter low-matching addresses to obtain addresses that meet the conditions;
[0038] Figure 2 This is a schematic diagram of a high-matching address obtained by using Levenshtein edit distance calculation in the present invention implemented in the fuzzywuzzy framework;
[0039] Figure 3 It is a flowchart of a fuzzy address matching method based on parallel processing in a power scenario according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0041] like Figure 3 As shown, an embodiment of the present invention provides a fuzzy address matching method for parallel processing in a power scenario, comprising the following steps:
[0042] Step 1: Data preprocessing: Preprocess the marketing addresses and intranet addresses in the distributed photovoltaic grid-connected information, including removing null values and outliers that are obviously not addresses, thereby reducing the impact of noise on subsequent processing.
[0043] The main goal of this stage is to remove those address records that are obviously invalid or incomplete, thereby reducing unnecessary computational burden and improving the efficiency of the entire process. First, identify and remove all records that are missing fields such as province, city, and district, because these fields are critical for accurate address matching, and their absence means that the entry cannot provide enough context for effective matching. At the same time, screen and exclude data points that are obviously not in a valid address format, including pure numeric sequences, random character combinations, or anything else that is obviously not an address, as well as strings that are too short or too long, which are likely to represent mis-entry or non-address information.
[0044] Step 2: Address grouping and area division
[0045] After completing step 1, we further narrow the matching scope by using regional divisions. This step aims to perform a preliminary geographical screening of the address information in the two data tables, ensuring that only addresses within the same or adjacent administrative divisions are considered for matching. We adopt a grouping strategy, grouping by district and county. Grouping at the district and county level allows for more precise search scope, ensuring that only geographically close and administratively related addresses are included in the match. Furthermore, the number of addresses within a district / county is typically far smaller than that of an entire city, effectively reducing the amount of data required for comparison. First, a list of all district and county names in Hubei Province is constructed. In each iteration, only those addresses that meet the criteria for the current district and county are selected for comparison. This means that for each district and county, only address records from the corresponding district and county in both data tables are loaded and processed. This approach not only reduces memory usage and I / O operations but also focuses computing resources on the areas most likely to produce correct matches, thereby improving processing speed and efficiency. By matching addresses only within the same district and county or between adjacent districts and counties, we avoid wasting resources on unnecessary comparisons between completely unrelated locations, significantly reducing the amount of data required for processing.
[0046] Step 3: Introduce a parallel computing framework to decompose the matching task: By introducing a parallel computing framework, the matching task is decomposed into multiple nodes for simultaneous execution through distributed computing resources.
[0047] Step 3 involves using the multiprocessing framework to execute tasks simultaneously by creating multiple independent processes, each with its own memory space and execution environment. The details are as follows:
[0048] After completing the district and county division and preliminary screening, in order to further improve the efficiency and speed of address matching, a parallel computing framework was introduced to fully utilize the capabilities of multi-core processors.
[0049] First, import the multiprocessing and functools.partial modules to support parallel processing and partial function application. Use the multiprocessing module to create a process pool object, pool. You can specify parameters to control the number of concurrently running processes. By default, this parameter is automatically set based on the number of CPU cores in the system. Next, define a matching function, match, which takes an address record to match (i.e., a marketing address) and a fixed list of addresses (i.e., intranet addresses). This function will execute the matching logic and return the matching result. To simplify task allocation, use functools.partial to create a new function instance with the second argument of the match function pre-bound, making it easier to pass different marketing addresses to the match function. Next, consolidate all marketing addresses for a particular district or county into a list. Each element in this list can be passed as the first argument to the match function. This step specifies which addresses will be included in the matching calculation for the current batch. Furthermore, a fixed list, the second argument to the match function, is constructed, containing the intranet addresses for the corresponding district or county.
[0050] Next, the pool.map() function is used to automatically distribute the task of matching each marketing address with the list of intranet addresses to idle worker processes. Specifically, pool.map() creates a matching task for each marketing address in the list and submits these tasks in parallel to the worker processes in the pool. Each worker process receives a marketing address and the entire list of intranet addresses as input parameters, executes the matching logic, and returns the best match score. Once all tasks are completed, pool.map() automatically aggregates the results to form a complete output list containing the best matches for all marketing addresses in the district or county. Finally, the pool.close() method is called to close the pool, preventing it from accepting new tasks. This marks the end of the task submission phase, preparing for subsequent worker process cleanup and resource release. The pool.join() method is then called, which blocks the main process until all worker processes in the pool complete their tasks and terminate. In other words, it causes the main process to wait until all child processes have completed their work. This ensures that all worker processes have completed their tasks, allowing the main process to terminate safely without losing any results or leaving any unfinished tasks.
[0051] Step 4: Matching calculation
[0052] Step 4 involves the use of the fuzzywuzzy framework, which provides a flexible and efficient method for fuzzy string matching based on the Levenshtein edit distance algorithm. This framework not only identifies subtly different but essentially identical addresses, but also rapidly processes large datasets, reducing computing resource usage. The details are as follows:
[0053] After setting up the parallel computing framework, fuzzy matching is implemented using the process module in fuzzywuzzy. The process.extractOne() function is used to select the single best match. This function accepts two main parameters: the target string to be matched, namely the marketing address, and a list of candidate strings containing intranet addresses. The similarity score between the marketing address and each intranet address in the list is calculated, and a tuple is returned containing the most similar string and its similarity score (an integer between 0 and 100). This score indicates the degree of match between the target string and the closest candidate string, with higher scores indicating a closer match. The score is calculated based on the Levenshtein distance, also known as the edit distance. This measure of the difference between two strings refers to the minimum number of single-character edit operations required to transform one string into the other. These edit operations include inserting, deleting, or replacing a character. To calculate the Levenshtein distance, a dynamic programming algorithm is typically used. This algorithm constructs a two-dimensional matrix to store the minimum edit distance for all possible substring combinations between the two strings. Each element in the matrix represents the edit distance between the two substrings at that position. For two strings of length m and n, respectively, this matrix is (m+1)×(n+1), where the first row and column represent the edit distance from the empty string to the respective string. The algorithm fills this matrix one by one until the final edit distance value is in the lower-right element. Each time a new element is added, the algorithm considers the three possible operations (insertion, deletion, or substitution) and chooses the one that minimizes the edit distance.
[0054] Step 5: Filter high-match results: Based on the similarity scores obtained in Step 4, select high-scoring matches with scores above 90 as preliminary results. Setting the threshold to 90 effectively eliminates clearly irrelevant or low-similarity candidates, ensuring that only highly certain matches are retained.
[0055] Step 6. Checking and filling in the gaps of low matching results: For those addresses with low matching degrees but that may have actual associations, the embodiment of the present invention has formulated special rules to check and fill in the gaps. For example, consider the following two addresses: "No. 15, Group 7, Shijing Village, Zilingpu Town, Dongbao District, Jingmen City, Hubei Province" and "No. 15, Group 7, Shijing Village, Zilingpu Town, Dongbao District". Although the second address lacks province and city information, resulting in a low initial matching score, the two addresses actually point to the same place. In order to solve such problems and improve matching accuracy, we introduced a string processing method based on regular expressions. Specifically, by using regular expressions to truncate the string, only the character part from "city" to "group" is retained, and then compared again. This method can effectively ignore non-critical address components (such as province, city, etc.) and focus on more specific geographical location descriptions (such as town, village, group and house number), thereby ensuring that even when some address information is incomplete, substantially identical address records can be identified. This not only compensates for omissions in low-match results, but also enhances the system's ability to handle non-standard input, improving the accuracy and reliability of overall address matching. In summary, by formulating specific rules and combining them with the application of regular expressions, we can ensure high-match screening while maintaining flexibility in handling addresses with low scores due to missing information.
[0056] Step 7: Final result output: Combine the results from step 5 and step 6. The final result includes not only addresses with high matching degree, but also addresses with low matching degree but meeting the conditions, such as Figure 1 and Figure 2 shown.
[0057] In power business scenarios, ensuring data compliance is a prerequisite for the smooth execution of all subsequent business processes. As a core asset in modern power management and operations, data quality directly impacts the effectiveness and reliability of key processes such as resource allocation, service planning, and energy scheduling. To address address mismatches in data, traditional address matching methods often rely on simple string comparisons or exact equality checks. These methods exhibit significant shortcomings when dealing with non-standardized input. Not only are they ineffective at identifying similar but not identical addresses, but they also suffer from extreme inefficiency when dealing with large datasets, with computational complexity exponentially increasing, resulting in slow processing and high resource consumption. The fuzzywuzzy framework is specifically designed for string fuzzy matching. It is particularly well-suited to addressing challenges faced by traditional address matching methods in power business scenarios, such as the difficulty of handling non-standardized data, the efficiency bottlenecks of large-scale data processing, and the limitations of fuzzy matching algorithms. Through its flexible and efficient matching capabilities, fuzzywuzzy not only identifies substantially identical addresses with slightly different representations, but also rapidly processes large datasets, reducing computing resources and ensuring that subsequent business processes are based on accurate and compliant data. This optimizes resource allocation, reduces operational risk, and supports more precise energy management and scheduling decisions. The core technology of fuzzywuzzy relies on the Levenshtein edit distance algorithm, which is a method of measuring the difference between two strings. It evaluates the similarity by calculating the minimum number of single-character editing operations (insertion, deletion, or substitution) required to convert one string into another. Specifically, fuzzywuzzy uses this principle to implement a quantitative assessment of string similarity, allowing users to set matching thresholds according to actual needs to filter out the most expected results. In addition, it also combines the fast edit distance calculation function provided by the Python-Levenshtein library to further improve performance. In order to achieve more accurate matching, fuzzywuzzy adopts a variety of strategies, including ignoring order differences, comparing after alphabetical arrangement, and considering partial string matching to adapt to different types of address information differences.
[0058] In order to further improve the accuracy of the fuzzywuzzy framework in address matching and make up for possible omissions or misjudgments, we can combine manually formulated rules to check for omissions and fill in the gaps. Here we implement the defined rules through regular expressions. As a text pattern matching tool, regular expressions allow the definition of complex search patterns to find, replace, or verify string content, which provides significant advantages in power business scenarios: it can achieve precise control and correct specific formats or common input errors; it has flexibility and scalability, and it is easy to adjust rules according to business needs; it improves processing efficiency by quickly filtering preset pattern entries; it provides detailed processing for special characters and abbreviations to enhance accuracy; it can also be integrated into automated scripts to achieve batch data cleaning and standardization, reducing manual intervention. Using rules as a supplementary means ensures the high accuracy and compliance of matching results, and improves the efficiency and reliability of the overall business process.
[0059] The multiprocessing parallel framework allows Python programs to execute multiple processes simultaneously, each with its own independent memory space and execution environment, significantly improving program performance and efficiency. This framework fully leverages the capabilities of modern multi-core processors, making processing-intensive or computationally intensive tasks more efficient. The main advantages of multiprocessing include parallel processing, which allows multiple tasks to be executed simultaneously, leveraging the advantages of multi-core processors; independence, with each process having its own independent address space and execution environment, preventing interference and enhancing program robustness and reliability; memory isolation, which isolates data between processes, reducing the complexity of data sharing and synchronization; fault isolation, which ensures that a process crash does not affect the execution of other processes, improving program stability and fault tolerance; and portability. Because processes are fundamental concepts provided by the operating system, multiprocessing can run on different operating systems, offering excellent cross-platform compatibility. Specifically, in Python, the underlying technical implementation of the multiprocessing module relies on the process management and communication mechanisms provided by the operating system. It achieves parallel processing by creating independent processes, each with its own memory space and Python interpreter instance. Due to the lack of support for fork() on Windows systems, the spawn method is used to launch a new Python interpreter process and re-import the main module to ensure a clean state for the new process. Interprocess communication (IPC) is implemented through mechanisms such as queues, pipes, and shared memory. Queues provide thread-safe objects for task distribution and result collection, while pipes are suitable for bidirectional communication between two processes. For frequent exchange of large amounts of data, shared memory allows different processes to access the same memory area, reducing data transfer overhead. Furthermore, to ensure secure data transfer between different process address spaces, multiprocessing utilizes Python's pickle module for data serialization and deserialization. For synchronization control, multiprocessing provides synchronization primitives such as locks, events, semaphores, and condition variables to coordinate access to shared resources or synchronize certain operations among multiple processes. Finally, the Pool class provides a high-level interface for managing a group of worker processes. It is responsible for creating a pool of worker processes, assigning tasks to idle processes, collecting results, and handling exceptions. It also maintains task and result queues to ensure efficient task processing. Through these mechanisms, the multiprocessing module effectively utilizes resources and achieves efficient parallel computing in multi-core or multi-CPU environments.
[0060] Therefore, by combining the FuzzyWuzzy framework, a regular expression-based rule system, and multi-process parallel processing technology, the present invention constructs an efficient and comprehensive address matching solution. FuzzyWuzzy, with its fuzzy matching capability based on the Levenshtein edit distance algorithm, can flexibly and efficiently identify address information that is slightly different in expression but essentially the same; at the same time, through predefined rules, it can achieve precise correction of specific formats and common erroneous inputs, ensuring the high accuracy and compliance of the matching results. Finally, the multiprocessing module is used for parallel processing, which not only fully utilizes the advantages of multi-core processors to accelerate computationally intensive tasks. The three complement each other and work together to improve the speed and efficiency of address matching for large-scale data sets.
[0061] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A fuzzy address matching method based on parallel processing in power scenarios, characterized in that: The steps include: Step 1: Data preprocessing: Preprocess the marketing addresses and intranet addresses in the distributed photovoltaic grid-connected information, including removing null values and outliers that are obviously not addresses; Step 2: Address grouping and regional division: Classify intranet addresses by geographical region to obtain address groups to narrow the matching range; Step 3: Introduce a parallel computing framework to decompose the task of matching the network address with the marketing address: By introducing a parallel computing framework and then using distributed computing resources, the matching task is decomposed into multiple nodes for simultaneous execution; Step 4: Matching calculation: Use the Levenshtein distance algorithm to calculate the similarity between the strings and obtain the similarity score between the intranet address and the marketing address. Step 5: Filter high-match results: Based on the calculated similarity score and the preset high-score threshold, filter out high-score matches as preliminary results; Step 6: Check for missing addresses with low matching scores: For addresses with low matching scores but potential for actual association, we develop specific rules and combine them with regular expressions to check for missing addresses and identify substantially identical address records. Step 7: Final result output: Combine the results obtained in steps 5 and 6 and output them.
2. The fuzzy address matching method based on parallel processing in the power scenario according to claim 1 is characterized in that: Step 1 data preprocessing specifically includes: first, identifying and removing all records that are missing a certain address segment; at the same time, screening and excluding data points that are not in a valid address format.
3. The fuzzy address matching method based on parallel processing in the power scenario according to claim 2 is characterized in that: The data points that are not in a valid address format include pure numeric sequences, random character combinations, or character strings that are too short or too long.
4. The fuzzy address matching method based on parallel processing in the power scenario according to claim 1 is characterized in that: Step 2: Address grouping and regional division specifically includes: building a list containing the names of all districts and counties in a province, and in each iteration, only selecting addresses that meet the conditions of the current processing district and county for comparison.
5. The fuzzy address matching method based on parallel processing in the power scenario according to claim 1 is characterized in that: Step 3 introduces a parallel computing framework to decompose the matching task, including: Step 3.
1. Import the multiprocessing and functools.partial modules to support parallel processing and partial function application. Use the multiprocessing module to create a process pool object, pool, and control the number of concurrently running processes by specifying parameters. Step 3.2: Define a matching function called match. One of the matching addresses is the address record to be matched, i.e., the marketing address, and the other is a fixed address list, i.e., the intranet address. The matching function matches executes the specific matching logic and returns the matching result. Step 3.3: Use the pool.map() function to automatically distribute the task of matching each marketing address with the intranet address list to idle worker processes.
6. The fuzzy address matching method based on parallel processing in the power scenario according to claim 5, characterized in that: Step 3.2 specifically includes: Use functools.partial to create a new function instance and pre-bind the second parameter of the match function to facilitate passing different marketing addresses to the match function. Then, all the marketing addresses of a certain district or county are integrated into a list. Each element in the list is passed as the first parameter of the match function. This step clarifies which addresses will participate in the matching calculation of the current batch. At the same time, a fixed list is constructed, which is the second parameter of the match function. This second parameter contains the intranet addresses of the corresponding district or county.
7. The fuzzy address matching method based on parallel processing in the power scenario according to claim 6, characterized in that: Step 3.3 specifically includes: The pool.map() function creates a matching task for each marketing address in the list and submits these tasks to the worker processes in the process pool in parallel. Each worker process receives a marketing address and the entire intranet address list as input parameters, then executes the matching logic and returns the best matching score. Once all tasks are completed, the pool.map() function automatically summarizes all results to form a complete output list containing the best matches for all marketing addresses in the district or county. Finally, the pool.close() method is called to close the process pool and no longer accept new tasks. The pool.join() method is then called to block the main process until all worker processes in the process pool complete their tasks and terminate.
8. The fuzzy address matching method based on parallel processing in the power scenario according to claim 1 is characterized in that: Step 4: Matching calculation specifically includes: After building the parallel computing framework, we implemented fuzzy matching using the process module in fuzzywuzzy and used the process.extractOne() function to select the single best match. The process.extractOne() function accepts two main parameters: the first is the target string to be matched, i.e., the marketing address, and the second is a list of candidate strings containing intranet addresses. By calculating the similarity score between the marketing address and each intranet address in the list, a tuple is returned. The tuple contains the most similar strings and the similarity score between them. The similarity score indicates the degree of match between the target string and the closest candidate string. A higher score indicates a closer match.
9. The fuzzy address matching method based on parallel processing in the power scenario according to claim 8, characterized in that: The similarity score is calculated based on the Levenshtein distance, also known as the edit distance, which is used to measure the difference between two strings. Specifically, it refers to the minimum number of single-character edit operations required to convert one string into another. The edit operation includes inserting, deleting, or replacing a character.
10. The fuzzy address matching method based on parallel processing in the power scenario according to claim 1, characterized in that: Step 6 checks and fills in the gaps in the low-matching results, specifically including: truncating the string by using a regular expression, retaining only some characters, and then comparing again.
Citation Information
Patent Citations
Power grid data association method based on address matching technology
CN108416062A
Address recognition method, device and apparatus and storage medium
CN111079386A
Address fuzzy matching method and system and computer equipment
CN111291099A
Address fuzzy matching method and device
CN111737315A
Address matching method, system and device and storage medium
CN114003812A