An address administrative division identification method, device, equipment and medium

By constructing a pre-defined linked list and zipper list structure for administrative division data, and combining it with target path selection constraint variables, the problems of name duplication and inefficiency in administrative division identification are solved, achieving efficient and accurate administrative division code identification.

CN115563409BActive Publication Date: 2026-02-06政采云股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211273190.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-18
Publication Date
2026-02-06
Estimated Expiration
2042-10-18

AI Technical Summary

Technical Problem

Existing technologies are prone to errors in identifying address information with the same name in administrative division identification, and the identification speed is slow and the efficiency is low.

Method used

By adopting a pre-defined linked list and zipper table structure for administrative division data, the system traverses the target address string, uses node clusters and zipper tables to find the administrative division code, and combines the target path selection constraint variables to avoid matching errors of districts with the same name and improve recognition efficiency.

Benefits of technology

This technology avoids errors in identifying addresses with the same name during the administrative division identification process, improving identification efficiency and speed while reducing the storage space required for pre-set data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563409B_ABST
    Figure CN115563409B_ABST
Patent Text Reader

Abstract

The application discloses an address administrative division identification method and device, equipment and medium, and relates to the technical field of information. The method comprises the following steps: acquiring a target address string corresponding to a target address to be identified, and setting an empty target path selection constraint variable for the target address string; traversing the target address string and determining a target administrative division first character according to a preset administrative division data linked list; searching for a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and sequentially and circularly advancing a node pointer and a character position until a current node cluster matching ends; and when it is necessary to switch between cross-level node clusters according to a zipper table, updating the target path selection constraint variable, and in a subsequent traversal process, determining a target administrative division code corresponding to the target address according to the target path selection constraint variable when multiple homonymously named divisions exist.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information technology, in particular to an address administrative division identification method, device, equipment and medium. BACKGROUND

[0002] Administrative division is a region divided by the state for the convenience of administrative management, and administrative division is also called administrative region. The civil affairs department of the State Council is responsible for the specific management of national administrative division. Other relevant departments of the State Council shall do well in the management of national administrative division according to their respective responsibilities. According to the administrative division code of the People's Republic of China, the administrative division code of the county and above is represented by six digits. The first two digits represent the province (autonomous region, municipality directly under the central government), the third and fourth digits represent the city (region, autonomous prefecture), the fifth and sixth digits represent the county (city district, county-level city), and the six administrative division codes contain the hierarchical administrative affiliation relationship of the province, city and county. At present, the corresponding administrative division code of the Chinese address can be found according to the administrative division code table, and the technology of automatically identifying the corresponding administrative division code of the Chinese address can more efficiently solve the problem of identifying the administrative division code. In related technologies, a plurality of division fields can be extracted from the address information to be identified, and the division fields are matched in the administrative division mapping table respectively, and finally the matching results of the plurality of administrative division fields are combined to determine the administrative division code corresponding to the address information to be identified. However, due to the existence of the same name in the address information, the matching of the administrative division code obtained by combining the plurality of division fields is not clear, which may lead to recognition errors. On the other hand, the matching of the plurality of division fields will lead to slow recognition speed and low efficiency. In summary, how to avoid the recognition error of the same name administrative division information and ensure the efficiency of the recognition process during the administrative division identification needs to be further solved. SUMMARY

[0003] Therefore, the purpose of the present application is to provide an address administrative division identification method, device, equipment and medium, which can avoid the recognition error of the same name address information and ensure the efficiency of the recognition process during the administrative division identification. The specific scheme is as follows:

[0004] In the first aspect, the present application discloses an address administrative division identification method, comprising:

[0005] obtaining a target address string corresponding to a target address to be identified, and setting an empty target path selection constraint variable for the target address string;

[0006] traversing the target address string and determining a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table;

[0007] finding a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and sequentially circulating and progressing a node pointer and a character position until a current node cluster matches an end;

[0008] When cross-level node cluster switching needs to be performed according to the linked list, updating the target path selection constraint variable, and determining the target administrative division code corresponding to the target address according to the target path selection constraint variable in a subsequent traversal process.

[0009] Optionally, before the target address string corresponding to a target address to be recognized is acquired and the empty target path selection constraint variable is set for the target address string, the method further includes:

[0010] The preset administrative division data linked list is constructed according to name characters, administrative division codes and administrative division superior-inferior relationships of all administrative divisions in an administrative division code table.

[0011] Optionally, the preset administrative division data linked list is constructed according to name characters, administrative division codes and administrative division superior-inferior relationships of all administrative divisions in an administrative division code table, and includes:

[0012] Reading the name characters and the administrative division codes of the administrative divisions in the administrative division code table, and constructing administrative division node clusters according to the name characters and the administrative division codes;

[0013] Constructing a cross-level linked list of the administrative divisions according to the administrative division node clusters and the administrative division superior-inferior relationships;

[0014] Constructing the preset administrative division data linked list according to the administrative division node clusters and the cross-level linked list of the administrative divisions.

[0015] Optionally, the name characters and the administrative division codes of the administrative divisions in the administrative division code table are read, and the administrative division node clusters are constructed according to the name characters and the administrative division codes, and include:

[0016] Reading a first character of the name characters of the administrative divisions in the administrative division code table, and constructing a node character according to the first character;

[0017] Reading characters after the first character of the name characters of the administrative divisions in the administrative division code table, and constructing the administrative division node clusters based on the node character and the administrative division codes.

[0018] Optionally, after the target administrative division first character is determined according to the preset administrative division data linked list, the method further includes:

[0019] If the corresponding target administrative division first character is not found in the target address string, it is determined that the address recognition for the target address string fails.

[0020] Optionally, when it is needed to switch the cross-level node cluster according to the zipper table, the target path selection constraint variable is updated, and after the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable when multiple homonymic divisions exist in the subsequent traversal process, the method further includes:

[0021] If the target administrative division code is a county-level code or a district-level code, the address recognition is ended and the target administrative division code is output.

[0022] If the target administrative division code is a non-county-level code and a district-level code, the next character of the target address string is recognized, and the jump-in entry of the next character node cluster in the preset administrative division data linked list is determined according to the next character.

[0023] Optionally, if the target administrative division code is a non-county-level code and a district-level code, and a zipper table entry is configured on the node, after the next character of the target address string is recognized and the entry node cluster corresponding to the next character in the preset administrative division data linked list is determined according to the next character, the method further includes:

[0024] The next character node corresponding to the next character of the next character is searched in the entry node cluster corresponding to the next character, and the node pointer and the character position are sequentially and circularly advanced until the current node cluster is matched.

[0025] The zipper table jump node cluster is switched, the target path selection constraint variable is updated to the recognized administrative division code, and then the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable.

[0026] In a second aspect, the application discloses an address administrative division recognition device, which includes:

[0027] An address string acquisition module is configured to acquire a target address string corresponding to a target address to be recognized, and set an empty target path selection constraint variable for the target address string.

[0028] A first character determination module is configured to traverse the target address string and determine a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table.

[0029] The node progressive module is configured to find a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and to sequentially and circularly progress a node pointer and a character position until a current node cluster matches an end.

[0030] The administrative division code determination module is configured to update the target path selection constraint variable when cross-level node cluster switching needs to be performed according to the linked list, and to determine a target administrative division code corresponding to the target address when multiple administrative divisions with the same name exist according to the target path selection constraint variable in a subsequent traversal process.

[0031] In a third aspect, the present application discloses an electronic device, comprising:

[0032] A memory is configured to save a computer program.

[0033] A processor is configured to execute the computer program to implement the steps of the address administrative division identification method disclosed above.

[0034] In a fourth aspect, the present application discloses a computer readable storage medium configured to store a computer program, wherein the computer program is executed by a processor to implement the steps of the address administrative division identification method disclosed above.

[0035] In the address administrative division identification, the target address string corresponding to the target address to be identified is obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. When cross-level node cluster switching needs to be performed according to the zipper table, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process. It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first obtained, and a target path selection constraint variable is set to be empty for the target address string. The target administrative division first character is determined by further traversing the target address string and according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is found in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and a node pointer and a character position are sequentially Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0037] Figure 1 A flowchart of an address administrative division identification method provided in this application;

[0038] Figure 2 A schematic diagram of the address administrative division identification process provided for this application;

[0039] Figure 3 A flowchart illustrating a specific address administrative division identification method provided in this application;

[0040] Figure 4 A schematic diagram illustrating the process of constructing the pre-defined administrative division data linked list provided for this application;

[0041] Figure 5 The intended representation of the pre-defined administrative division data chain provided in this application;

[0042] Figure 6 A schematic diagram of an address administrative division identification device provided in this application;

[0043] Figure 7 This application provides a structural diagram of an electronic device. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] In the related art, several division fields can be extracted from the address information to be identified, and the division fields are matched in the administrative division mapping table respectively, and finally the matching results of the several administrative division fields are combined to determine the administrative division code corresponding to the address information to be identified. However, due to the same name in the address information, the matching is not clear when the administrative division code is obtained by combining several division fields, which leads to the problem of identification error. On the other hand, the matching of several division fields needs to be performed multiple times, which leads to the problem of slow identification speed and low efficiency. Therefore, the present application provides an address administrative division identification method which can avoid the identification error of the same name administrative division information and ensure the efficiency in the identification process.

[0046] The embodiment of the present application discloses an address administrative division identification method, as shown in Figure 1 The method comprises the following steps:

[0047] Step S11: obtaining a target address string corresponding to a target address to be identified, and setting an empty target path selection constraint variable for the target address string.

[0048] In the embodiment, the target address string corresponding to the target address to be identified is obtained, and the empty target path selection constraint variable is set for the target address string. Specifically, the target address string is the string corresponding to the target address, and after obtaining the target address string corresponding to the target address to be identified, the target path selection constraint variable is set for the target address string, and the target path selection constraint variable is marked as empty. It can be understood that the target path selection constraint variable is used to constrain the path of the target administrative division code, that is, the role of the target path selection constraint variable is to eliminate the same name division, so as to determine the target administrative division code corresponding to the target address according to the target path selection constraint variable subsequently. Through the above technical solution, the target address string corresponding to the target address to be identified is obtained, so as to facilitate the subsequent traversal of the target address string and identification of the target administrative division code corresponding to the target address string.

[0049] Step S12: traversing the target address string and determining a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table.

[0050] In the embodiment, the target address string is traversed and a target administrative division first character is determined according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zippered list constructed according to an administrative division code table. Specifically, starting from a first character of the target address string, an entry hash table of the node cluster is queried. If the target administrative division first character exists, the target administrative division first character is determined. If the target administrative division first character does not exist, a next character of the target address string is queried. It can be understood that if the target administrative division first character does not hit the entry hash table in the target address string, it is determined that the recognition for the target address string fails. It should be noted that the single-direction node linked list group diverges from the same starting point. Each node of the linked list represents a Chinese character and is used to represent the character order of the administrative division name. Each node contains a Chinese character or an English character, 0-n single-direction node pointers to the next node, and an administrative division code array related to the node. Because the county-level administrative division has the same name, for example, “Shizhong District” is associated with 370103 Shandong Province Jinan Shizhong District, 370402 Shandong Province Zaozhuang Shizhong District, 511002 Sichuan Province Neijiang Shizhong District, and 511102 Sichuan Province Leshan Shizhong District, four different county-level administrative divisions. The administrative division code data is used to store the four code items. Through the above technical solution, the target administrative division first character is determined, so that the second character node corresponding to the next character of the target administrative division first character and subsequent nodes in the first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list are found.

[0051] Step S13: finding the second character node corresponding to the next character of the target administrative division first character in the first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and sequentially and circularly advancing the node pointer and the character position until the current node cluster matching ends.

[0052] In the embodiment, the second character node corresponding to the next character of the target administrative division first character is found in the first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and the node pointer and the character position are sequentially and circularly advanced until the current node cluster matching ends. Specifically, in the first node cluster corresponding to the current target administrative division first character, whether the first node pointed to by the entry contains the second character node pointer corresponding to the next address character is queried. If yes, the pointer and the address character position are advanced. If the corresponding target administrative division first character is not found in the target address string, it is determined that the address recognition for the target address string fails.

[0053] Step S14: updating the target path selection constraint variable when cross-level node cluster switching according to the zipper list is needed, and determining the target administrative division code corresponding to the target address according to the target path selection constraint variable in the subsequent traversal process when multiple homonymic divisions exist.

[0054] In this embodiment, when cross-level node cluster switching according to the zipper list is needed, the target path selection constraint variable is updated, and the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable in the subsequent traversal process when multiple homonymic divisions exist. If the target administrative division code is a county-level code or a district-level code, the address recognition is ended and the target administrative division code is output. If the target administrative division code is a non-county-level code and a district-level code, the next character of the target address string is recognized, and the node cluster entry corresponding to the next character is determined in the preset administrative division data linked list according to the next character. Specifically, the address administrative division recognition flowchart is as shown in Figure 2 The next character of the next character of the next character corresponding to the character node in the next character node cluster is found, and the node pointer and the character position are sequentially and circularly advanced until the current node cluster matching is ended. When the zipper list jumps to the node cluster, the target path selection constraint variable is updated to the recognized administrative division code, and the target administrative division code corresponding to the target address is subsequently determined according to the target path selection constraint variable. The multiple administrative division code arrays in the division code associated with the current node are analyzed, and the appropriate administrative division code is selected according to the current target path selection constraint variable. If the selected code is a county (district) level, the parsing is ended and the current code is returned. If the selected code is a non-county (district) level, the next character of the address is advanced and the zipper list related to the selected code is queried. If the zipper list contains the next address advancing character, the current node pointer jumps into the new node cluster, and the path selection constraint variable is set to the selected code. If the next address advancing character is not found in the zipper list, the parsing process is ended and the current selected code is output.

[0055] In this embodiment, the node data related to different levels of administrative divisions is associated in the form of a zipper list, effectively reducing the repeated representation of multiple levels of nodes, thereby reducing the storage space of the preset data. A same set of simplified division name node clusters is used for multiple levels of administrative divisions. To solve the problem of homonymic division names and abbreviations, a target path selection constraint variable is introduced. When the first division node cluster is accessed, the path selection target path selection constraint variable is empty. When jumping into the lower-level division node cluster through the zipper list, the administrative division code belonging to the zipper list is brought in to replace the target path selection constraint variable. In the subsequent traversal of the node cluster, the path selection constraint variable is matched, and the codes that do not match the level are not selected.

[0056] It can be seen that in the address administrative division identification, the target address string corresponding to the target address to be identified is first acquired, and an empty target path selection constraint variable is set for the target address string. Then, the target address string is further traversed, and a target administrative division first character is determined according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is searched for in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list. A node pointer and a character position are sequentially and circularly advanced until a current node cluster matching ends. The target path selection constraint variable is updated when cross-level node cluster switching is needed according to the zipper table. In the subsequent traversal process, a target administrative division code corresponding to the target address is determined according to the target path selection constraint variable. It can be seen that in the address administrative division identification, after the target address string is traversed and the target administrative division first character is determined according to the preset administrative division data linked list, the second character is sequentially searched for according to the first character corresponding to the first node cluster, and the node pointer and the character position are sequentially and circularly advanced until the current node cluster matching ends. Therefore, in the address administrative division identification, the matching result is directly output by single traversal of the name and address strings, and the text recognition calculation efficiency is the highest. On the other hand, the node cluster and the zipper table are constructed according to the administrative division code table to obtain the preset administrative division data linked list, and the administrative division code of the target address is identified according to the preset administrative division data linked list. The node data related to the administrative division level is associated in the form of the zipper table, which effectively reduces the repeated representation of the multi-level nodes, thereby reducing the storage space of the preset data. Furthermore, the same-name division is excluded by the target path selection constraint variable, and the problem of identification error caused by unclear matching is avoided. In summary, the present application can avoid the identification error of the same-name administrative division information and ensure the efficiency in the identification process.

[0057] Referring to Figure 3 The embodiment of the present application discloses a specific address administrative division identification method. Compared with the previous embodiment, the technical solution is further described and optimized.

[0058] Step S21: constructing the preset administrative division data linked list according to the name characters, the administrative division codes and the administrative division superior-inferior relationship of all administrative divisions in the administrative division code table.

[0059] In the embodiment, the preset administrative division data linked list is constructed according to the name characters, administrative division codes and administrative division superior-inferior relations of all administrative divisions in the administrative division code table, which includes: reading the name characters and administrative division codes of administrative divisions in the administrative division code table, and constructing administrative division node clusters according to the name characters and the administrative division codes; constructing the cross-level zip list of the administrative divisions according to the administrative division node clusters and the administrative division superior-inferior relations; and constructing the preset administrative division data linked list according to the administrative division node clusters and the cross-level zip list of the administrative divisions. Specifically, the administrative division table can be stored in a text file or a database record, depending on the application scenario. The number of administrative divisions in the 2022 version is 3212, and the administrative division code table contains administrative division name characters, administrative division abbreviations and division codes. The first character of the name characters of the administrative divisions in the administrative division code table is read, and the node characters are constructed according to the first character. The subsequent characters after the first character of the name characters of the administrative divisions in the administrative division code table are read, and the administrative division node clusters are constructed based on the node characters and the administrative division codes.

[0060] In the embodiment, the preset administrative division data linked list construction process is shown in the following figure Figure 4As shown, the administrative division information is read in a loop, and node clusters are constructed for the division name and abbreviation respectively. The first character of the name is read, and the entry hash table is queried with the first character as the parameter. If the node does not exist, it is created. If the node exists, it is directly located, and the node pointer is returned and marked as the current node. The characters are read one by one from the second position of the name string. It is queried in the current node whether there is a next node related to the character. If the node does not exist, it is created. If the node exists, the pointer is returned and marked as the current node. Finally, the code association array of the current node is checked and the administrative division code is read. According to the administrative division table in the 2022 version, the number of node clusters loaded is 927. Further, the levels of administrative divisions are divided into two levels and three levels. The two levels are the municipalities directly under the central government and the subordinate counties. The three levels are the provinces, cities (places), and counties (districts). The zipper table is set at the provincial (municipal) and municipal (place) level, i.e., the first level and the second level of the division. The zipper table stores the first characters of the names of all subordinate and sub-subordinate divisions of the division. The administrative division code and the first character of the name are read in a loop, the superior division code and the superior-superior division code of the current administrative division code are extracted, and all superior division codes are processed respectively. The specified level of the superior division code is queried in the zipper table hash table. If the specified level of the superior division code does not exist, the zipper table is created. If the specified level of the superior division code exists, the corresponding zipper table is directly returned. The first character of the current administrative division name is added to the returned superior zipper table, and the zipper table does not store duplicate characters. According to the administrative division table in the 2022 version, the number of administrative divisions configured for the zipper table is 360, the longest zipper table character number is 142, and the average zipper table character number is 13.

[0061] In the present embodiment, the preset administrative division data chain represents the intention as Figure 5As shown, a multi-span subordinate character linked list is constructed to associate the name node cluster with the upper and lower hierarchical relationship. The provincial node linked list stores the first characters of the names of the cities and counties under the provincial node and the first characters of all subordinate county-level names. The city node linked list stores the first characters of the names of the counties under the city node. The municipal node linked list only stores the first characters of the names of the subordinate counties. To enhance the fault tolerance of the recognition algorithm, the commonly used abbreviations of each division are also added. For example, "Urumqi City" is abbreviated as "U City", and "Tumed Left Banner" is abbreviated as "Tuzuoqi". Various commonly used address representation methods such as "Zhejiang Province Hangzhou Xihu District", "Hangzhou Xihu District", "Hangzhou Xihu District", "Xinjiang Uygur Autonomous Region Yili Kazakh Autonomous Prefecture Horgos City", "Xinjiang Yili Horgos City", "Xinjiang Horgos City", and "Horgos City" can be recognized. After the node cluster and the linked list are constructed, the address string can be compared and queried character by character. Each address only needs to be traversed once, and the administrative division recognition work can be completed. Through the above technical scheme, the memory linked list is used to store the standard content, which does not depend on the query matching ability of the database. An address analysis only needs to be traversed once, and the node cluster can be queried to determine. The name similarity algorithm is not used to save computing resources. The recognition can be started from any node, and the applicability is good.

[0062] Step S22: obtaining a target address string corresponding to a target address to be recognized, and setting an empty target path selection constraint variable for the target address string.

[0063] Step S23: traversing the target address string and determining a target administrative division first character according to the preset administrative division data linked list.

[0064] If the corresponding target administrative division first character is not found in the target address string, it is determined that the address recognition for the target address string fails.

[0065] Step S24: finding a second character node corresponding to the next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and sequentially and circularly progressing the node pointer and the character position until the current node cluster matching ends.

[0066] Step S25: when it is necessary to switch the node cluster across the levels according to the linked list, updating the target path selection constraint variable, and determining the target administrative division code corresponding to the target address when multiple names of the same division exist in the subsequent traversal process according to the target path selection constraint variable.

[0067] It can be seen that in the embodiment, the administrative division name abbreviation mode is supported, and the definition of the unconventional path can gradually improve the recognition fault tolerance. The storage of the zipper table can be realized by means of ordered array, unordered array, linked list and hash table; the node associated division code array can be pre-set by means of presetting all division code arrays and using array index of the code to replace code string storage, so as to save the storage space of the code string; the administrative division abbreviation can be configured by means of artificial configuration of the administrative region table, and can also be configured by means of automatic name simplification method, and the common abbreviation elements such as nationality, "autonomy", "joint flag", "province", "special administrative region", "region", "state", "city", "county", "league", "flag" and the like are removed.

[0068] Referring to Figure 6 The embodiment of the application discloses an address administrative division recognition device, which comprises:

[0069] An address string acquisition module 11 is configured to acquire a target address string corresponding to a target address to be recognized, and set an empty target path selection constraint variable for the target address string;

[0070] A first character determination module 12 is configured to traverse the target address string and determine a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table;

[0071] A node progression module 13 is configured to find a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and sequentially and circularly progress a node pointer and a character position until a current node cluster matching ends;

[0072] An administrative division code determination module 14 is configured to update the target path selection constraint variable when it is necessary to switch a cross-level node cluster according to the zipper table, and determine a target administrative division code corresponding to the target address according to the target path selection constraint variable when multiple same-named divisions exist in a subsequent traversal process.

[0073] It can be seen that, in the address administrative division identification, the target address string corresponding to the target address to be identified is first acquired, and an empty target path selection constraint variable is set for the target address string. Then, the target address string is further traversed, and a target administrative division first character is determined according to a preset administrative division data linked list. The preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table. A second character node corresponding to a next character of the target administrative division first character is searched in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list. A node pointer and a character position are sequentially and circularly advanced until the current node cluster matching ends. The target path selection constraint variable is updated when cross-level node cluster switching is needed according to the zipper table. In the subsequent traversal process, the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable. It can be seen that, in the address administrative division identification, after the target address string is traversed and the target administrative division first character is determined according to the preset administrative division data linked list, the second character is sequentially searched according to the first character corresponding to the first node cluster, and the node pointer and the character position are sequentially and circularly advanced until the current node cluster matching ends. Therefore, in the address administrative division identification, the matching result is directly output by single traversal of the name and address string, and the text recognition calculation efficiency is the highest. On the other hand, the node cluster and the zipper table are constructed according to the administrative division code table to obtain the preset administrative division data linked list, and the administrative division code of the target address is identified according to the preset administrative division data linked list. The node data related to the administrative division level is associated in the form of the zipper table, which effectively reduces the repeated representation of the multi-level nodes, thereby reducing the storage space of the preset data. Furthermore, the same-named division is excluded by the target path selection constraint variable, which avoids the problem of identification error caused by unclear matching. In summary, the present application can avoid the identification error of the same-named administrative division information and ensure the efficiency in the identification process.

[0074] In some specific embodiments, the address administrative division identification device further comprises:

[0075] The data linked list construction module is configured to construct the preset administrative division data linked list according to the name characters, the administrative division codes and the administrative division superior-inferior relationship of all administrative divisions in the administrative division code table.

[0076] In some specific embodiments, the data linked list construction module specifically comprises:

[0077] The administrative division node cluster construction unit is configured to read the name characters and the administrative division codes of the administrative divisions in the administrative division code table, and construct an administrative division node cluster according to the name characters and the administrative division codes.

[0078] a cross-level linked list construction unit configured to construct a cross-level linked list of the administrative divisions according to the administrative division node cluster and the administrative division superior-inferior relationship;

[0079] an administrative division data linked list construction unit configured to construct a preset administrative division data linked list according to the administrative division node cluster and the cross-level linked list of the administrative divisions.

[0080] In some embodiments, the administrative division node cluster construction unit is specifically configured to: read a first character of a name character of an administrative division in the administrative division code table, and construct a node character according to the first character; and read a character after the first character of the name character of the administrative division in the administrative division code table, and construct an administrative division node cluster based on the node character and the administrative division code.

[0081] In some embodiments, the address administrative division identification device further comprises:

[0082] a failure determination module configured to determine that the address identification for the target address string fails if no corresponding target administrative division first character is found in the target address string.

[0083] In some embodiments, the address administrative division identification device further comprises:

[0084] an end module configured to end the address identification and output the target administrative division code if the target administrative division code is a county-level code or a district-level code.

[0085] a continuous identification module configured to identify a next character of the target address string and determine a node cluster entry corresponding to the next character in the preset administrative division data linked list according to the next character if the target administrative division code is a non-county-level code and a non-district-level code, and a linked list entry is configured on the node.

[0086] In some embodiments, the address administrative division identification device further comprises:

[0087] a next-level node cluster determination module configured to find a corresponding character node of the next character in the entry node cluster corresponding to the next level, and sequentially loop and progress a node pointer and a character position until a current node cluster matching ends.

[0088] a target path selection constraint variable updating module configured to update the target path selection constraint variable to an identified administrative division code according to the linked list jump node cluster, and then determine a target administrative division code corresponding to the target address according to the target path selection constraint variable.

[0089] Figure 7 An electronic device 20 provided by the embodiment of the present application is shown. The electronic device 20 specifically can further include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the processor 21 is configured to load and execute the computer program to implement the related steps in the address administrative division identification method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiment specifically can be an electronic computer.

[0090] In the embodiment, the power supply 23 is configured to provide voltage for each hardware device on the electronic device 20; the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not specifically limited here; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not specifically limited here.

[0091] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.

[0092] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the address administrative division identification method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.

[0093] Further, the present application further discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the address administrative division identification method disclosed above. The specific steps of the method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0094] Finally, it needs to be pointed out that in this document, relational terms such as first and second and the like can only be intended to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or even include elements inherent to such process, method, article, or apparatus. Without more limitations, an element defined by an "comprising" statement serves as a means plus function alternative.

[0095] The above describes in detail the address administrative division identification method, device, equipment and medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges can be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. An address administrative district identification method characterized by, The method comprises the following steps: obtaining a target address string corresponding to a target address to be recognized, and setting an empty target path selection constraint variable for the target address string; traversing the target address string and determining a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper table constructed according to an administrative division code table; finding a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and circularly and progressively updating a node pointer and a character position until a current node cluster is matched; when it is necessary to switch between node clusters at different levels according to the zipper table, updating the target path selection constraint variable, and determining a target administrative division code corresponding to the target address when multiple administrative divisions with the same name exist in a subsequent traversal process according to the target path selection constraint variable; wherein the node cluster is constructed in the following manner: reading the names and abbreviations of administrative divisions in the administrative division code table, constructing an entry hash table based on the first characters corresponding to the names and abbreviations, creating a new node as a current node if the node corresponding to the first character does not exist, or using the node corresponding to the first character as the current node if the node corresponding to the first character exists, then reading target characters after the first character one by one, and querying whether a target node corresponding to the target character exists in the current node; if a target node corresponding to the target character does not exist, a new node is created as the current node; if a target node corresponding to the target character exists, the target node is used as the current node; and each node is associated with a code array of the corresponding administrative division; wherein the zipper table is constructed in the following manner: performing hash table query based on the upper-level administrative division code of the target-level administrative division; if the upper-level administrative division code of the target-level administrative division does not exist, a corresponding zipper table is created; if the upper-level administrative division code of the target-level administrative division exists, the corresponding zipper table is returned, and the first characters of the names of the lower-level administrative division and the lower-lower-level administrative division of the target level are added to the zipper table; the target level includes province / municipality and city / county; and the zipper table does not store duplicate characters.

2. The address administrative division identification method according to claim 1, characterized in that, Before the step of obtaining a target address string corresponding to a target address to be recognized, and setting an empty target path selection constraint variable for the target address string, the method further comprises the following step: constructing the preset administrative division data linked list according to the name characters, administrative division codes, and administrative division upper-lower level relationships of all administrative divisions in the administrative division code table.

3. The address administrative division identification method according to claim 2, characterized in that, The step of constructing the preset administrative division data linked list according to the name characters, administrative division codes, and administrative division upper-lower level relationships of all administrative divisions in the administrative division code table comprises the following steps: reading the name characters and administrative division codes of administrative divisions in the administrative division code table, and constructing an administrative division node cluster according to the name characters and the administrative division codes; constructing a cross-level zipper list of the administrative divisions according to the administrative division node clusters and the cross-level relationship of the administrative divisions; constructing the preset administrative division data linked list according to the administrative division node clusters and the cross-level zipper list of the administrative divisions.

4. The address administrative division identification method according to claim 3, characterized in that, The reading of the name character and the administrative division code of the administrative division in the administrative division code table and the construction of the administrative division node cluster according to the name character and the administrative division code comprises: reading the first character of the name character of the administrative division in the administrative division code table and constructing a node character according to the first character; reading the character after the first character of the name character of the administrative division in the administrative division code table and constructing an administrative division node cluster based on the node character and the administrative division code.

5. The address administrative division identification method of claim 1, wherein, The traversing of the target address character string and the determination of the target administrative division first character according to the preset administrative division data linked list further comprises: if the corresponding target administrative division first character is not found in the target address character string, it is determined that the address recognition for the target address character string fails.

6. The address administrative division identification method according to any one of claims 1 to 5, characterized in that, When cross-level node cluster switching according to the zipper list is required, the target path selection constraint variable is updated, and after the target administrative division code corresponding to the target address is determined according to the target path selection constraint variable when multiple administrative divisions with the same name exist in the subsequent traversal process, the method further comprises: if the target administrative division code is a county-level code or a district-level code, the address recognition is ended and the target administrative division code is output; if the target administrative division code is a non-county-level code and a district-level code, and a zipper list entry is configured on the node, the next character of the target address character string is recognized, and the next character corresponding node cluster entry in the preset administrative division data linked list is determined according to the next character.

7. The address administrative district identification method according to claim 6, characterized by, After the target administrative division code is a non-county-level code and a district-level code, and a zipper list entry is configured on the node, the next character of the target address character string is recognized, and the next character corresponding node cluster entry in the preset administrative division data linked list is determined according to the next character, the method further comprises: finding the corresponding character node of the next character in the entry node cluster corresponding to the next character, and sequentially circulating and progressing the node pointer and the character position until the current node cluster matching ends; jumping to the node cluster according to the zipper list, updating the target path selection constraint variable to the recognized administrative division code, and then determining the target administrative division code corresponding to the target address according to the target path selection constraint variable.

8. An address administrative district identification apparatus characterized by comprising: comprise: an address character string acquisition module, configured to acquire a target address character string corresponding to a target address to be recognized, and set an empty target path selection constraint variable for the target address character string; a first character determination module, configured to traverse the target address character string and determine a target administrative division first character according to a preset administrative division data linked list; the preset administrative division data linked list is a node cluster and a zipper list constructed according to an administrative division code table; The node advancing module is configured to find a second character node corresponding to a next character of the target administrative division first character in a first node cluster corresponding to the target administrative division first character in the preset administrative division data linked list, and to sequentially and circularly advance a node pointer and a character position until a current node cluster matches an end; The administrative division code determination module is configured to update the target path selection constraint variable when cross-level node cluster switching needs to be performed according to the linked list, and to determine a target administrative division code corresponding to the target address when multiple administrative divisions with the same name exist in a subsequent traversal process according to the target path selection constraint variable. The first character determination module is configured to read administrative division names and abbreviations of administrative divisions in an administrative division code table, to construct an entry hash table based on first characters corresponding to the administrative division names and the abbreviations, to create a new node as a current node if a node corresponding to the first character does not exist, to use the node corresponding to the first character as the current node if the node corresponding to the first character exists, to read a target character after the first character character by character, to query whether a target node corresponding to the target character exists in the current node, to create a new node as the current node if the target node corresponding to the target character does not exist, and to use the target node corresponding to the target character as the current node if the target node corresponding to the target character exists, and to associate a code array of an administrative division corresponding to each node. The first character determination module is configured to perform hash query based on an upper-level administrative division code of an administrative division at a target level, to create a corresponding linked list if the upper-level administrative division code of the administrative division at the target level does not exist, to return the corresponding linked list if the upper-level administrative division code of the administrative division at the target level exists, and to add first characters of division names of lower-level divisions and lower-lower-level divisions at the target level in the linked list.

9. An electronic device, comprising: The memory is configured to save a computer program. The processor is configured to execute the computer program to implement steps of the address administrative division identification method according to any one of claims 1 to 7. The memory is configured to save a computer program.

10. A computer readable storage medium characterized by, The memory is configured to save a computer program.

Citation Information

Patent Citations

  • Address identification method, device and equipment and computer readable storage medium

    CN111680500A

  • Address identification method, electronic equipment and storage medium

    CN115168546A