Address map construction method and device, computer device and readable storage medium
By generating an initial single-word tree graph from the address database and calculating the difference parameters and non-standard nodes, the problem of inaccurate and slow address database updates in existing technologies is solved, realizing the automated generation of standardized address graphs, which are suitable for grid management and equipment installation in the security field.
Patent Information
- Application Number
- CN202111406408.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2041-11-24
AI Technical Summary
In existing address map construction methods, address segmentation based on word segmentation and part-of-speech recognition is difficult to construct a unified address hierarchy, and the model update speed cannot keep up with the actual generation speed of new addresses, resulting in an inaccurate address database and is time-consuming and labor-intensive.
By obtaining the standard address level address dataset from the first address database, an initial single-word tree graph is generated, the difference parameters and the number of single-byte points are calculated, non-standard nodes are merged, the target address graph is generated, and the address level difference parameters and the number of nodes are processed using a linear fitting function to automatically update the address level graph.
It enables the automated generation of standardized address maps, improving the accuracy and update efficiency of the address database. No expert supervision is required, making it suitable for grid management and security equipment installation in the security field.
Smart Images

Figure CN114064927B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of knowledge graph, and in particular to an address graph construction method and device, computer equipment and readable storage medium. BACKGROUND
[0002] In the field of security and protection, standardized hierarchical addresses are often needed to facilitate the smooth development of security and protection work. For example, standardized hierarchical addresses are needed for grid management of actual addresses of public security, and standardized addresses are configured when security and protection cameras are installed.
[0003] At present, in most cases, the addresses used are inaccurate address libraries constructed by manual construction. If work is carried out relying on the inaccurate address library, it not only consumes time and effort, but also often doubles the effort for half the result.
[0004] In the current address graph construction method, address segmentation based purely on word segmentation and part-of-speech recognition is difficult to construct unified address hierarchical relationships, and the model updating speed of word segmentation and part-of-speech recognition often cannot keep up with the generation speed of new addresses. SUMMARY
[0005] To solve the above technical problems, the present application provides an address graph construction method, device, computer equipment and readable storage medium, and the specific solutions are as follows:
[0006] In a first aspect, the present application provides an address graph construction method, which comprises:
[0007] From the first address database, according to the preset standard address hierarchy, obtain the address data set corresponding to each address hierarchy, wherein the preset standard address hierarchy is greater than the four-level address hierarchy;
[0008] According to the preset rule, traverse the address data set in each address hierarchy to generate a corresponding initial single-character tree graph, wherein the initial single-character tree graph comprises a plurality of single-character nodes corresponding to each address hierarchy;
[0009] Traverse all single-character nodes in the first four address hierarchies in the initial single-character tree graph, calculate the difference parameter corresponding to each address hierarchy and the number of first single-character nodes in each address hierarchy, wherein the difference parameter is the difference between the maximum proportion value of the single-character node and the minimum proportion value of the single-character node;
[0010] According to the difference parameter corresponding to the first four address hierarchies and the number of first single-character nodes corresponding to the first four address hierarchies, the single-character nodes of all address hierarchies after the fourth address hierarchy in the initial single-character tree graph are merged to generate a target address graph.
[0011] According to a specific embodiment of the present application, the step of traversing the address data set in each address level according to the preset rule to generate the corresponding initial single-character tree-shaped atlas comprises:
[0012] If the current Chinese character does not include a parent node, the number proportion of the current Chinese character in the address data set of the address level to which the current Chinese character belongs is calculated;
[0013] The current Chinese character with the number proportion greater than the preset proportion threshold is taken as a child node of the root node;
[0014] Based on all the child nodes of the root node, the corresponding initial single-character tree-shaped atlas is generated according to the preset child node proportion algorithm and the address data set corresponding to each address level.
[0015] According to a specific embodiment of the present application, the step of traversing all single-character nodes in the first four address levels in the initial single-character tree-shaped atlas and calculating the difference parameter corresponding to each address level comprises:
[0016] All single-character nodes in the first four address levels in the initial single-character tree-shaped atlas are traversed;
[0017] The standard address data in the second database is traversed, and the standard address data comprises standard data of the province-city-district-county four-level address level;
[0018] The number proportion of each single-character node in the standard address data corresponding to the address level is calculated;
[0019] The difference between the maximum proportion value and the minimum proportion value of the single-character nodes in the corresponding address level is calculated to obtain the difference parameter of the corresponding address level.
[0020] According to a specific embodiment of the present application, the step of merging the single-character nodes of all address levels after the fourth-level address level in the initial single-character tree-shaped atlas according to the difference parameters corresponding to the first four address levels and the number of the first single-character nodes corresponding to the first four address levels comprises:
[0021] The difference parameters of the first four address levels are processed according to the preset linear fitting function to obtain the target difference parameter of the address level corresponding to the preset standard address level;
[0022] The number of the first single-character nodes corresponding to the first four address levels is processed according to the preset linear fitting function to obtain the target number of the first single-character nodes of the address level corresponding to the preset standard address level;
[0023] After traversing the fourth level address hierarchy, when the number of single character nodes is greater than a preset multiple of the target number, merging all traversed single character nodes;
[0024] When the difference between the proportion of the number of single character nodes and the maximum proportion of single character nodes is greater than the target difference parameter, discarding the single character node.
[0025] According to an embodiment of the present application, after the step of generating a target address graph, the method further comprises:
[0026] Traversing all nodes in the target address graph;
[0027] Comparing the coincidence degree between the child nodes of each node;
[0028] If the coincidence degree is higher than a preset value, recursively merging the two child nodes whose coincidence degree is higher than the preset value;
[0029] If the coincidence degree is lower than a preset value, retaining the two child nodes whose coincidence degree is lower than the preset value.
[0030] According to an embodiment of the present application, after the step of generating a target address graph, the method further comprises:
[0031] Comparing the coincidence degree between the child nodes of each node;
[0032] If the coincidence degree is higher than a preset value, recursively merging the two child nodes whose coincidence degree is higher than the preset value;
[0033] If the coincidence degree is lower than a preset value, retaining the two child nodes whose coincidence degree is lower than the preset value.
[0034] According to an embodiment of the present application, the first four levels of address hierarchy are province, city, district and county.
[0035] In a second aspect, the embodiments of the present application provide an address graph construction device, and the device comprises:
[0036] An acquisition module is configured to acquire, from a first address database, an address data set corresponding to each address level according to a preset standard address level, wherein the preset standard address level is greater than a four-level address level;
[0037] A first construction module is configured to traverse the address data set in each address level according to a preset rule to generate a corresponding initial single character tree graph, wherein the initial single character tree graph comprises a plurality of single character nodes corresponding to each address level;
[0038] The traversal module is configured to traverse all single-character nodes in the first four address levels in the initial single-character tree map, calculate a difference parameter corresponding to each address level and a number of first single-character nodes in each address level, wherein the difference parameter is a difference between a maximum single-character node proportion value and a minimum single-character node proportion value.
[0039] The second construction module is configured to merge single-character nodes in all address levels after the fourth address level in the initial single-character tree map according to the difference parameter corresponding to the first four address levels and the number of first single-character nodes corresponding to the first four address levels, to generate a target address map.
[0040] In a third aspect, an embodiment of the present application provides a computer device, including a processor and a memory, the memory storing a computer program, the computer program being executed on the processor to perform the address map construction method in the first aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed on a processor to perform the address map construction method in the first aspect.
[0042] The address map construction method, device, computer device and readable storage medium provided in the embodiments of the present application, the method comprising: obtaining an address data set corresponding to each address level from a first address database according to a preset standard address level; traversing the address data set in each address level according to a preset rule to generate a corresponding initial single-character tree map; traversing all single-character nodes in the first four address levels in the initial single-character tree map, calculating a difference parameter corresponding to each address level and a number of first single-character nodes in each address level; merging single-character nodes in all address levels after the fourth address level in the initial single-character tree map according to the difference parameter corresponding to the first four address levels and the number of first single-character nodes, to generate a target address map. The address map construction method provided in the embodiments of the present application can automatically generate a standard address map with multiple address levels according to the update of corpus data. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope of protection of the present application. In each drawing, similar components are denoted by similar reference numerals.
[0044] Figure 1 A method flow diagram of an address map construction method provided in an embodiment of the present application is shown;
[0045] Figure 2 An effect schematic diagram of an initial single-word tree-shaped map of an address map construction method provided by an embodiment of the present application is shown.
[0046] Figure 3 An effect schematic diagram of a target address map of an address map construction method provided by an embodiment of the present application is shown.
[0047] Figure 4 A device module schematic diagram of an address map construction device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application.
[0049] The components of the embodiments of the present application generally described and illustrated in the accompanying drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0050] Hereinafter, the terms "include", "have", and their conjugates, used in various embodiments of the present application, are merely intended to denote a specific characteristic, number, step, operation, element, component, or combination thereof, and should not be construed as excluding the existence or possibility of one or more other features, numbers, steps, operations, elements, components, or combinations thereof.
[0051] In addition, the terms "first", "second", "third", and the like are used only to distinguish descriptions, and should not be understood as indicating or implying relative importance.
[0052] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present application belong. The terms (such as terms defined in a generally used dictionary) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized or overly formal meaning, unless clearly defined in various embodiments of the present application.
[0053] REFERENCE Figure 1A method flowchart of an address atlas construction method provided by an embodiment of the present application, the address atlas construction method provided by an embodiment of the present application, as shown in Figure 1 includes the following steps.
[0054] In step S101, address data sets corresponding to each address level are obtained from a first address database according to a preset standard address level, wherein the preset standard address level is greater than a four-level address level.
[0055] In specific embodiments, the address data in the first address database can be address data obtained from any address data source, such as address data in an electronic map, a household address in a personal ID, etc.
[0056] The preset standard address level is detailed address data down to a street address level, wherein the first four address levels are province, city, district, and county.
[0057] The address data formed according to the preset standard address level can be a country, province, city, district, road, and community, or a country, province, city, county, town, road, and community, and the specific standard address level can be adaptively set according to the address data obtained from the first address database.
[0058] It should be noted that the data in the first address database can also be address corpus data input by a user in real time through a terminal device.
[0059] In step S102, address data sets in each address level are traversed according to a preset rule to generate a corresponding initial single-character tree-shaped atlas, wherein the initial single-character tree-shaped atlas includes a plurality of single-character nodes corresponding to each address level.
[0060] In specific embodiments, the address data of each level address corresponding to the preset standard address level obtained in the above step is traversed and combined to generate an initial single-character tree-shaped atlas as shown in Figure 2 .
[0061] Figure 2 A diagram of atlas content of the first address level in the initial single-character tree-shaped atlas.
[0062] More specifically, the step of traversing address data sets in each address level according to a preset rule to generate a corresponding initial single-character tree-shaped atlas includes the following steps.
[0063] All Chinese characters in the address data set are traversed, and if the current Chinese character does not include a parent node, the proportion of the number of the current Chinese character in the address data set of the address level to which the current Chinese character belongs is calculated.
[0064] If the number ratio of the current Chinese character is greater than the preset ratio threshold, the current Chinese character is taken as a child node of the root node.
[0065] Based on all child nodes of the root node, an initial single-character tree graph is generated according to a preset child node ratio algorithm and address data sets corresponding to each address level.
[0066] In specific embodiments, the address data sets in each address level are traversed from the first Chinese character to the last Chinese character in the form of a tree graph. During the traversal, corresponding judgment actions and calculation actions are performed for each Chinese character.
[0067] The judgment actions include judging whether the current Chinese character includes a parent node and judging whether the number ratio of the current Chinese character exceeds the preset ratio threshold.
[0068] The calculation actions include calculating the number ratio of the current Chinese character in the address data set of the address level, i.e., calculating the ratio of the number of occurrences of the current Chinese character in the address data set corresponding to the address level to the total number of Chinese characters.
[0069] If the current Chinese character does not include a parent node, the current Chinese character node is a child node of the root node. If the number ratio of the current Chinese character is less than the preset ratio threshold, it indicates that the current Chinese character node is not the address data belonging to the address data in the first address level in the standard address data, and the current Chinese character node is directly discarded.
[0070] For example, as shown in FIG. 1, the child node “Jiang” of the root node includes two child nodes “Xi” and “Huai”, Jiangxi belongs to the address data commonly appearing in the standard address level, and Jianghuai does not belong to the address data commonly appearing in the standard address level. It is calculated that the number ratio of the “Huai” node is less than the preset ratio threshold, and the “Huai” node is directly discarded. It is calculated that the number ratio of the “Xi” node is greater than the preset ratio threshold, and the “Xi” node is taken as a child node of the “Jiang” node. Figure 2
[0071] The preset child node algorithm takes each child node of the root node as a new root node, calculates the number ratio of the next node, and takes the node with a number ratio higher than the preset ratio threshold as a new child node. The preset child node algorithm is repeatedly executed until the last character in the address data set is traversed, to form an initial single-character tree graph.
[0072] In step S103, all single-character nodes in the first four address levels in the initial single-character tree graph are traversed, and a difference parameter corresponding to each address level and the number of the first single-character node in each address level are calculated. The difference parameter is the difference between the maximum ratio value of the single-character node and the minimum ratio value of the single-character node.
[0073] In specific embodiments, since the standard address data in the national public data includes address data of the first four levels, the parameters that can predict the address level data after the fourth level can be calculated through each single character node in the first four levels of the initial single character tree map, for predicting and generating a standard address map with a preset number of address levels.
[0074] The step of calculating the number of the first single character node in each address level can be performed after obtaining the initial single character tree map, and a preset level division action is performed on the initial single character tree map to identify the initial single character tree map corresponding to each standard address level. The number of the first single character node corresponding to each standard address level is counted, and the number of the first single character node corresponding to each address level is obtained.
[0075] The number of each single character node in the standard address data is calculated, and then the maximum single character node ratio value and the minimum single character node ratio value corresponding to each address level are obtained. The difference between the maximum single character node ratio value and the minimum single character node ratio value is calculated, and the difference parameter corresponding to each address level is obtained.
[0076] According to a specific embodiment of the present application, the step of traversing all single character nodes in the first four levels of the initial single character tree map to calculate the difference parameter corresponding to each address level comprises:
[0077] Traverse all single character nodes in the first four levels of the initial single character tree map.
[0078] Traverse the standard address data in the second database, and the standard address data includes standard data of the province-city-district-county four-level address level.
[0079] Calculate the number ratio of each single character node in the corresponding address level standard address data.
[0080] Calculate the difference between the maximum single character node ratio value and the minimum single character node ratio value in the corresponding address level to obtain the difference parameter corresponding to the address level.
[0081] In specific embodiments, the second database is a standard database including the province-city-district-county four-level address level address data in the national public data.
[0082] Let the difference parameter of each address level be X, where the difference parameter of the first address level is X_1, and the difference parameter of the i-th address level is X_i. Let the number of the first character of each address level be Y, where the number of the first character of the first address level is Y_1, and the number of the first character of the i-th address level is Y_i.
[0083] Step S104, according to the difference parameters corresponding to the first four address levels and the number of the first single-word nodes corresponding to the first four address levels, merging the single-word nodes of all address levels after the fourth address level in the initial single-word tree map to generate a target address map.
[0084] In specific embodiments, after obtaining the difference parameters X_1, X_2, X_3 corresponding to the first four address levels, and the number of the first single-word nodes Y_1, Y_2, and Y_3 corresponding to the first four address levels, the single-word nodes of all address levels after the fourth address level can be predicted according to the difference parameters and the number of the first single-word nodes corresponding to the first four address levels, and the single-word nodes can be merged according to the corresponding standard address levels to generate a target address map as shown in Figure 3 .
[0085] Wherein, Figure 3 is a schematic diagram of a target address map of a street / community address level after a district address level.
[0086] According to a specific embodiment of the present application, the step of merging the single-word nodes of all address levels after the fourth address level in the initial single-word tree map according to the difference parameters corresponding to the first four address levels and the number of the first single-word nodes corresponding to the first four address levels includes:
[0087] processing the difference parameters of the first four address levels according to a preset linear fitting function to obtain a target difference parameter of the address level corresponding to the preset standard address level;
[0088] processing the number of the first single-word nodes corresponding to the first four address levels according to a preset linear fitting function to obtain a target number of the first single-word nodes of the address level corresponding to the preset standard address level;
[0089] traversing the initial single-word tree map after the fourth address level, and when the number of single-word nodes is greater than a preset multiple of the target number, merging all traversed single-word nodes;
[0090] when the difference between the proportion of the number of single-word nodes and the maximum proportion value of single-word nodes is greater than the target difference parameter, discarding the single-word nodes.
[0091] In specific embodiments, after predicting the target difference parameter X_i and the target number Y_i of the first single-word nodes corresponding to the preset standard address level by the preset linear fitting function, the single-word nodes in the initial single-word tree map after the fourth address level can be screened and merged by the target difference parameter X_i and the target number Y_i.
[0092] It should be noted that the preset linear fitting function can be any function used in existing linear fitting methods, which is not limited here.
[0093] The tree map of the next layer is traversed from the district address level, and when the number of child nodes is greater than 2 times Y_i, all previously traversed child nodes are merged into a new tree map corresponding to the address level of the layer.
[0094] When the ratio of the number of single-word nodes to the maximum proportion of single-word nodes is greater than X_i, it is indicated that the single-word node does not belong to the address data in the standard address level, and the single-word node is directly discarded.
[0095] According to a specific embodiment of the present application, after the step of generating the target address map, the method further comprises:
[0096] Traversing all nodes in the target address map;
[0097] Comparing the coincidence degree between the child nodes of each node;
[0098] If the coincidence degree is higher than a preset value, recursively merging the two child nodes with the coincidence degree higher than the preset value;
[0099] If the coincidence degree is lower than a preset value, retaining the two child nodes with the coincidence degree lower than the preset value.
[0100] In specific embodiments, after obtaining the target address map, different address trees indicating the same address in the target address map are also merged.
[0101] For example, as shown in 3, the "Nanming District" node includes the "XX Community" node and the "Huai X Street" node, and if the addresses indicated by the "XX Community" and the "Huai X Street" are actually the same address area, the coincidence degree of the "XX Community" node and the "Huai X Street" node is calculated to be higher than a preset value, at which time the "XX Community" node and the "Huai X Street" node are recursively merged and unified to be modified into a standard "Huai X Street" node.
[0102] The calculation of the coincidence degree can use existing calculation methods for calculating address coincidence, which is not specifically limited here.
[0103] The preset value can be 50%, 60% or 70%, which can be adaptively adjusted according to the effect in actual application.
[0104] According to a specific embodiment of the present application, after the step of generating the target address map, the method further comprises:
[0105] comparing the coincidence degree between each node;
[0106] if the coincidence degree is higher than the preset value, recursively merging the two nodes with the coincidence degree higher than the preset value;
[0107] if the coincidence degree is lower than the preset value, retaining the two nodes with the coincidence degree lower than the preset value.
[0108] In specific embodiments, it is also necessary to compare whether there is an indication of the same address between different nodes. The calculation method and comparison method of the coincidence degree can refer to the specific implementation in the above embodiments, which will not be described here.
[0109] The address graph construction method provided by the application can automatically generate an address graph with a standard address hierarchy according to corpus data without supervision, and does not need to be checked by experts. The address graph construction method of the application can update the address hierarchy graph in real time according to data updates, and has high reliability and learning ability.
[0110] Reference Figure 4 A device module schematic diagram of an address graph construction device 400 provided by an embodiment of the application is provided. As shown in Figure 4 The address graph construction device 400 comprises:
[0111] The acquisition module 401 is configured to acquire, from a first address database, an address data set corresponding to each address hierarchy according to a preset standard address hierarchy, wherein the preset standard address hierarchy is greater than a four-level address hierarchy.
[0112] The first construction module 402 is configured to traverse the address data set in each address hierarchy according to a preset rule to generate a corresponding initial single-character tree-shaped graph, wherein the initial single-character tree-shaped graph comprises a plurality of single-character nodes corresponding to each address hierarchy.
[0113] The traversal module 403 is configured to traverse all single-character nodes in the first four address hierarchies in the initial single-character tree-shaped graph, calculate a difference parameter corresponding to each address hierarchy and the number of first single-character nodes in each address hierarchy, wherein the difference parameter is the difference between the maximum proportion value of the single-character nodes and the minimum proportion value of the single-character nodes.
[0114] The second construction module 404 is configured to merge the single-character nodes of all address hierarchies after the fourth address hierarchy in the initial single-character tree-shaped graph according to the difference parameter corresponding to the first four address hierarchies and the number of first single-character nodes corresponding to the first four address hierarchies, to generate a target address graph.
[0115] In addition, the embodiment of the present application provides a computer device, comprising a processor and a memory, the memory stores a computer program, and the computer program executes the address atlas construction method in the above embodiment when running on the processor.
[0116] The embodiment of the present application also provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program executes the address atlas construction method in the above embodiment when running on the processor.
[0117] In summary, the embodiment of the present application provides an address atlas construction method, device, computer device and readable storage medium, through the address atlas construction method of the present application, the learning and construction of the knowledge graph can be completed only by providing address corpus data, and the address hierarchical atlas can be updated in real time according to the update of the address data. Without expert supervision and assistance, the actual multi-level standard address atlas can be automatically generated, which can be applied to various security fields and is conducive to the standardization of the address atlas. In addition, the specific implementation of the address atlas construction device, computer device and computer readable storage medium provided by the embodiment of the present application can refer to the specific implementation of the above method embodiment, which will not be described here.
[0118] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and structural diagrams in the drawings show the possible implementation architectures, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in alternative implementation ways, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the structural diagram and / or flowchart, and the combination of blocks in the structural diagram and / or flowchart, can be implemented by a dedicated hardware-based system for executing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0119] In addition, each functional module or unit in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0120] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. An address map construction method, characterized by, The method comprises: obtaining address data sets corresponding to each address level from a first address database according to preset standard address levels, wherein the preset standard address levels are greater than four address levels; traversing the address data sets in each address level according to preset rules to generate corresponding initial single-character tree graphs, wherein the initial single-character tree graphs comprise a plurality of single-character nodes corresponding to each address level; traversing all single-character nodes in the first four address levels in the initial single-character tree graph, calculating a difference parameter corresponding to each address level and the number of first single-character nodes in each address level, wherein the difference parameter is the difference between the maximum single-character node proportion and the minimum single-character node proportion; the maximum single-character node proportion is the maximum number proportion of single-character nodes in standard address data, and the minimum single-character node proportion is the minimum number proportion of single-character nodes in the standard address data; merging single-character nodes in all address levels after the fourth address level in the initial single-character tree graph according to the difference parameters corresponding to the first four address levels and the number of first single-character nodes corresponding to the first four address levels to generate a target address graph; the step of merging single-character nodes in all address levels after the fourth address level in the initial single-character tree graph according to the difference parameters corresponding to the first four address levels and the number of first single-character nodes corresponding to the first four address levels comprises: processing the difference parameters of the first four address levels according to a preset linear fitting function to obtain a target difference parameter corresponding to the address level of the preset standard address level; processing the number of first single-character nodes corresponding to the first four address levels according to a preset linear fitting function to obtain a target number of first single-character nodes corresponding to the address level of the preset standard address level; traversing the initial single-character tree graph after the fourth address level, and merging all traversed single-character nodes when the number of single-character nodes is greater than a preset multiple of the target number; discarding the single-character node when the difference between the number proportion of the single-character node and the maximum single-character node proportion is greater than the target difference parameter.
2. The method of claim 1, wherein, the step of traversing the address data sets in each address level according to preset rules to generate corresponding initial single-character tree graphs comprises: traversing all Chinese characters in the address data set, and calculating the number proportion of the current Chinese character in the address data set of the address level to which the current Chinese character belongs if the current Chinese character does not include a parent node; taking the current Chinese character with a number proportion greater than a preset proportion threshold as a child node of a root node; generating a corresponding initial single-character tree graph based on all child nodes of the root node according to a preset child node proportion algorithm and the address data sets corresponding to each address level; the preset child node proportion algorithm is used to take the child nodes of each root node as new root nodes and calculate the number proportion of the next node, and take the node with a number proportion higher than a preset proportion threshold as a new child node.
3. The method of claim 1, wherein, the step of traversing all single-character nodes in the first four address levels in the initial single-character tree graph and calculating a difference parameter corresponding to each address level comprises: traverse all the single-word nodes in the first four levels of the initial single-word tree map; traverse the standard address data in the second database, the standard address data including standard data of the four levels of province, city, district and county; calculate the proportion of the number of each single-word node in the corresponding address level standard address data; calculate the difference between the maximum proportion value and the minimum proportion value of the single-word nodes in the corresponding address level to obtain the difference parameter of the corresponding address level.
4. The method of claim 1, wherein, After the step of generating the target address map, the method further comprises: traverse all the nodes in the target address map; compare the coincidence degree between the child nodes of each node; if the coincidence degree is higher than a preset value, recursively merge the two child nodes with the coincidence degree higher than the preset value; if the coincidence degree is lower than a preset value, keep the two child nodes with the coincidence degree lower than the preset value.
5. The method of claim 1, wherein, After the step of generating the target address map, the method further comprises: compare the coincidence degree between the child nodes of each node; if the coincidence degree is higher than a preset value, recursively merge the two child nodes with the coincidence degree higher than the preset value; if the coincidence degree is lower than a preset value, keep the two child nodes with the coincidence degree lower than the preset value.
6. The method of claim 1, wherein, The first four levels of address levels are province, city, district and county.
7. An address map construction apparatus characterized by comprising: The device for executing the address map construction method of claim 1 comprises: an acquisition module for acquiring, from a first address database, address data sets corresponding to each address level according to a preset standard address level, wherein the preset standard address level is greater than four levels of address levels; a first construction module for traversing the address data sets in each address level according to a preset rule to generate a corresponding initial single-word tree map, the initial single-word tree map including a plurality of single-word nodes corresponding to each address level; a traversal module for traversing all the single-word nodes in the first four levels of the initial single-word tree map, calculating the difference parameter of each address level and the number of the first single-word node in each address level, wherein the difference parameter is the difference between the maximum proportion value and the minimum proportion value of the single-word nodes; a second construction module for merging the single-word nodes of all address levels after the fourth level of address levels in the initial single-word tree map according to the difference parameters corresponding to the first four levels of address levels and the number of the first single-word node corresponding to the first four levels of address levels to generate a target address map.
8. A computer device, comprising: A device comprising a processor and a memory, the memory storing a computer program, the computer program executing the address map construction method of any one of claims 1-6 when running on the processor.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, the computer program executing the address map construction method of any one of claims 1-6 when running on the processor.
Citation Information
Patent Citations
Address storage structure, address resolution method and device, medium and computer equipment
CN112181978A
Address information standardization method and device, electronic equipment and storage medium
CN112632213A